:root {
  --app-height: 100vh;
  --app-height: 100dvh;
  --app-width: 100vw;
  --vv-offset-top: 0px;
  --vv-offset-left: 0px;
  --bg: #eaf1ff;
  --panel: #ffffff;
  --panel-2: #f4f7fb;
  --line: #dce5ef;
  --text: #17211f;
  --muted: #64748b;
  --accent: #1473ff;
  --accent-2: #0f766e;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 18px 48px rgba(18, 33, 31, 0.12);
  --radius: 8px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

/* Personal secretary: boss-only reminders, appointments, and daily planning. */
.agent-secretary-planner-card {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.secretary-planner-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.secretary-planner-toolbar input[type="date"] {
  min-width: 150px;
  flex: 1 1 150px;
}

.secretary-plan-summary,
.secretary-plan-timeline,
.secretary-appointment-form {
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface, #fff) 94%, #eef6ff 6%);
  padding: 14px;
}

.secretary-plan-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.secretary-plan-headline strong {
  color: var(--text-strong, #10233f);
  font-size: 15px;
}

.secretary-plan-headline span {
  color: var(--text-muted, #64748b);
  font-size: 12px;
  white-space: nowrap;
}

.secretary-plan-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.secretary-plan-metrics > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-soft, #f5f8fc);
}

.secretary-plan-metrics span,
.secretary-plan-metrics small {
  color: var(--text-muted, #64748b);
  font-size: 11px;
}

.secretary-plan-metrics strong {
  color: var(--text-strong, #10233f);
  font-size: 20px;
}

.secretary-plan-metrics .alert {
  background: #fff1f0;
}

.secretary-plan-metrics .alert strong {
  color: #c2413b;
}

.secretary-suggestions {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e6;
  color: #754f11;
  font-size: 12px;
}

.secretary-suggestions ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.secretary-timeline-list,
.secretary-appointment-list {
  display: grid;
  gap: 8px;
}

.secretary-timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border, #dbe3ee);
  border-left: 4px solid #5b8def;
  border-radius: 12px;
  background: var(--surface, #fff);
  color: inherit;
  text-align: left;
}

.secretary-timeline-item.reminder,
.secretary-timeline-item.high {
  border-left-color: #f59e0b;
}

.secretary-timeline-item.critical {
  border-left-color: #dc3f3f;
  background: #fff8f8;
}

.secretary-timeline-item time {
  color: #2457a7;
  font-weight: 800;
}

.secretary-timeline-item > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.secretary-timeline-item strong,
.secretary-timeline-item small {
  overflow-wrap: anywhere;
}

.secretary-timeline-item small {
  color: var(--text-muted, #64748b);
  font-size: 11px;
}

.secretary-appointment-form {
  display: grid;
  gap: 12px;
}

.secretary-appointment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.secretary-appointment-title-field,
.secretary-appointment-description-field {
  grid-column: 1 / -1;
}

.secretary-list-title {
  margin-top: 2px;
}

.secretary-appointment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border, #dbe3ee);
  border-left: 4px solid #5b8def;
  border-radius: 14px;
  background: var(--surface, #fff);
}

.secretary-appointment-item.high {
  border-left-color: #f59e0b;
}

.secretary-appointment-item.critical {
  border-left-color: #dc3f3f;
}

.secretary-appointment-item.done {
  opacity: .62;
}

.secretary-appointment-item > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.secretary-appointment-item strong,
.secretary-appointment-item small,
.secretary-appointment-item p {
  overflow-wrap: anywhere;
}

.secretary-appointment-item small,
.secretary-appointment-item p {
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.secretary-appointment-item p {
  margin: 2px 0 0;
}

.secretary-appointment-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 6px;
}

.today-secretary-panel .today-list {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .secretary-plan-metrics,
  .secretary-appointment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secretary-timeline-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .secretary-appointment-item {
    grid-template-columns: 1fr;
  }

  .secretary-appointment-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .secretary-plan-headline {
    display: grid;
  }

  .secretary-plan-headline span {
    white-space: normal;
  }

  .secretary-plan-metrics,
  .secretary-appointment-grid {
    grid-template-columns: 1fr;
  }

  .secretary-appointment-title-field,
  .secretary-appointment-description-field {
    grid-column: auto;
  }
}

/* Sell-ready setup center: one safe surface for every external connection. */
.admin-setup-center-card {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 0;
  border-color: #b9d9d2;
  background:
    radial-gradient(circle at 92% 6%, rgba(20, 184, 166, 0.16), transparent 27%),
    linear-gradient(150deg, #f6fffc 0%, #ffffff 58%);
  box-shadow: 0 14px 36px rgba(15, 118, 110, 0.09);
}

.setup-center-heading {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.13);
}

.setup-center-heading > div:first-child {
  min-width: 0;
}

.setup-center-kicker {
  display: block;
  margin-bottom: 5px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.setup-center-heading h3 {
  margin: 0;
  color: #0f2f2b;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.2;
}

.setup-center-heading p {
  max-width: 780px;
  margin: 7px 0 0;
  color: #526b66;
  font-size: 13px;
  line-height: 1.55;
}

.setup-center-heading-actions {
  display: grid;
  min-width: 220px;
  gap: 8px;
  justify-items: end;
}

.setup-center-progress {
  padding: 7px 11px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 999px;
  color: #0f766e;
  background: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.setup-center-connections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 24px;
}

.setup-connection-card {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce8e5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.setup-connection-card > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.setup-connection-card strong,
.setup-connection-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-connection-card strong {
  color: #173f39;
  font-size: 13px;
}

.setup-connection-card small {
  color: #6a7e79;
  font-size: 10px;
}

.setup-connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.setup-connection-card.ready .setup-connection-dot {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.setup-connection-card.optional .setup-connection-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.setup-connection-state {
  padding: 4px 7px;
  border-radius: 999px;
  color: #9a5a00;
  background: #fff7dd;
  font-size: 10px;
  font-weight: 900;
}

.setup-connection-card.ready .setup-connection-state {
  color: #047857;
  background: #dcfce7;
}

.setup-connection-card.optional .setup-connection-state {
  color: #64748b;
  background: #f1f5f9;
}

.setup-connection-card.is-loading span,
.setup-connection-card.is-loading strong,
.setup-connection-card.is-loading small {
  min-height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef5f3, #ffffff, #eef5f3);
  background-size: 200% 100%;
  animation: setup-shimmer 1.25s linear infinite;
}

@keyframes setup-shimmer {
  to { background-position: -200% 0; }
}

.setup-center-form {
  display: grid;
  gap: 0;
}

.setup-center-groups {
  display: grid;
  gap: 10px;
  padding: 4px 24px 18px;
}

.setup-center-loading {
  padding: 22px;
  border: 1px dashed #c9dcd8;
  border-radius: 12px;
  color: #617a74;
  text-align: center;
}

.setup-group {
  overflow: hidden;
  border: 1px solid #d7e6e2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.setup-group > summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px 15px;
  color: #183f39;
  cursor: pointer;
  list-style: none;
}

.setup-group > summary::-webkit-details-marker {
  display: none;
}

.setup-group > summary:hover {
  background: #f4fbf9;
}

.setup-group > summary > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.setup-group > summary small {
  overflow: hidden;
  color: #71827e;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-group-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: #0f766e;
  background: #e6f6f2;
  font-size: 11px;
  font-weight: 900;
}

.setup-group-count {
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
}

.setup-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 15px;
  border-top: 1px solid #e3eeeb;
  background: #fbfefd;
}

.setup-field {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 7px;
  padding: 12px;
  border: 1px solid #e0ebe8;
  border-radius: 10px;
  background: #fff;
}

.setup-field.is-wide {
  grid-column: 1 / -1;
}

.setup-field.is-advanced {
  border-style: dashed;
}

.setup-field > label:first-child {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  color: #263e3a;
  font-size: 12px;
  font-weight: 800;
}

.setup-field > label:first-child > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.setup-field > label:first-child code {
  overflow: hidden;
  max-width: 48%;
  color: #8a9996;
  font-size: 8px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-restart-pill {
  padding: 2px 5px;
  border-radius: 999px;
  color: #9a5a00;
  background: #fff4ce;
  font-size: 8px;
  font-weight: 900;
}

.setup-field input:not([type="checkbox"]),
.setup-field select,
.setup-field textarea {
  width: 100%;
  min-height: 40px;
}

.setup-field textarea {
  resize: vertical;
}

.setup-field-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  align-items: center;
  min-height: 18px;
  color: #74837f;
  font-size: 10px;
}

.setup-field-meta > small {
  flex: 1 1 210px;
  line-height: 1.4;
}

.setup-secret-status {
  color: #9a6700;
  font-weight: 800;
}

.setup-secret-status.ready {
  color: #047857;
}

.setup-secret-clear {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
  color: #b42318;
  cursor: pointer;
}

.setup-toggle-control {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  cursor: pointer;
}

.setup-toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setup-toggle-control > span {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: 0.18s ease;
}

.setup-toggle-control > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  content: "";
  transition: 0.18s ease;
}

.setup-toggle-control input:checked + span {
  background: #0f766e;
}

.setup-toggle-control input:checked + span::after {
  transform: translateX(20px);
}

.setup-toggle-control em {
  color: #5d6f6a;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.setup-center-alert {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0 24px 12px;
  padding: 12px 14px;
  border: 1px solid #f2cf78;
  border-radius: 10px;
  color: #7a4a00;
  background: #fff8df;
}

.setup-center-alert > div {
  display: grid;
  gap: 3px;
}

.setup-center-alert span {
  font-size: 11px;
}

.setup-center-alert code {
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.setup-center-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #dbe9e5;
  background: rgba(241, 250, 247, 0.88);
}

.setup-center-footer > div {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  color: #35534d;
  font-size: 11px;
}

.setup-center-footer > div span {
  color: #71827e;
}

@media (max-width: 920px) {
  .setup-center-connections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-center-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-center-heading-actions {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: start;
  }
}

@media (max-width: 620px) {
  .setup-center-heading,
  .setup-center-connections,
  .setup-center-groups,
  .setup-center-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .setup-center-connections,
  .setup-field-grid {
    grid-template-columns: 1fr;
  }

  .setup-field.is-wide {
    grid-column: auto;
  }

  .setup-group > summary {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .setup-group-count {
    display: none;
  }

  .setup-center-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-center-footer button {
    width: 100%;
  }
}

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body * {
    visibility: hidden !important;
  }

  #hr-v2-slip-dialog,
  #hr-v2-slip-dialog * {
    visibility: visible !important;
  }

  dialog.modal.hr-v2-slip-dialog {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .hr-v2-slip-dialog::backdrop,
  .hr-v2-slip-dialog > .dialog-close-form,
  .hr-v2-slip-dialog > .dialog-actions,
  .hr-v2-payroll-day-details,
  .hr-v2-slip > small {
    display: none !important;
  }

  #hr-v2-slip-content {
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .hr-v2-slip {
    box-sizing: border-box !important;
    display: grid !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 273mm !important;
    gap: 3mm !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 9pt !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .hr-v2-slip-letterhead {
    display: flex !important;
    gap: 6mm !important;
    padding-bottom: 3mm !important;
    break-inside: avoid;
  }

  .hr-v2-slip-company {
    display: flex !important;
    gap: 4mm !important;
  }

  .hr-v2-slip-company img {
    width: 42mm !important;
    height: auto !important;
  }

  .hr-v2-slip-company-copy strong {
    font-size: 11pt !important;
  }

  .hr-v2-slip-company-copy span {
    font-size: 7pt !important;
  }

  .hr-v2-slip-document-meta {
    min-width: 60mm !important;
    padding: 0 0 0 5mm !important;
    border-top: 0 !important;
    border-left: 0.25mm solid #cbd5e1 !important;
    text-align: right !important;
  }

  .hr-v2-slip-document-meta h3 {
    font-size: 16pt !important;
  }

  .hr-v2-slip-document-meta dl div {
    justify-content: flex-end !important;
  }

  .hr-v2-slip-period {
    grid-template-columns: minmax(0, 1.5fr) minmax(48mm, 1fr) minmax(32mm, 0.7fr) !important;
    break-inside: avoid;
  }

  .hr-v2-slip-period > div {
    padding: 2mm 3mm !important;
  }

  .hr-v2-slip-employee {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)) !important;
    gap: 3mm !important;
    padding: 3mm !important;
    break-inside: avoid;
  }

  .hr-v2-slip .integration-note {
    margin: 0 !important;
    padding: 2mm 3mm !important;
    border-width: 0.25mm !important;
    border-radius: 1.5mm !important;
    font-size: 7.5pt !important;
    break-inside: avoid;
  }

  .hr-v2-slip .integration-note ul {
    margin: 1mm 0 0 !important;
    padding-left: 5mm !important;
  }

  .hr-v2-slip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1.5mm !important;
    break-inside: avoid;
  }

  .hr-v2-slip-grid div {
    min-height: 10mm !important;
    padding: 1.5mm 2mm !important;
    border-radius: 1.5mm !important;
  }

  .hr-v2-slip-money {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 2.5mm !important;
    break-inside: avoid;
  }

  .hr-v2-slip-money > section {
    padding: 3mm !important;
    border-radius: 1.5mm !important;
  }

  .hr-v2-payroll-line {
    padding: 1.2mm 0 !important;
    font-size: 8.5pt !important;
  }

  .hr-v2-slip-money .net {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 2.5mm 3mm !important;
  }

  .hr-v2-slip-money .net strong {
    grid-row: 1 / span 2 !important;
    grid-column: 2 !important;
    font-size: 18pt !important;
  }

  .hr-v2-slip-footer {
    align-self: end;
    gap: 4mm !important;
    margin-top: auto;
    break-inside: avoid;
  }

  .hr-v2-slip-note {
    padding: 2mm 3mm !important;
    font-size: 7.5pt !important;
  }

  .hr-v2-slip-note .hr-v2-attendance-breakdown-card {
    gap: 1mm !important;
    margin-top: 1mm !important;
    padding: 1.5mm 2mm !important;
    border-width: 0.2mm !important;
    break-inside: avoid;
  }

  .hr-v2-slip-note .hr-v2-attendance-breakdown-card > ul {
    gap: 0.5mm !important;
  }

  .hr-v2-slip-note .hr-v2-attendance-breakdown-card li {
    gap: 2mm !important;
    padding-top: 0.8mm !important;
  }

  .hr-v2-slip-signatures {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10mm !important;
  }

  .hr-v2-slip-signatures > div > span {
    height: 11mm !important;
  }

  .hr-v2-slip-system-footer {
    padding-top: 2mm !important;
    font-size: 6.5pt !important;
  }
}

/* HR employee directory and individual file */
.hr-employee-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  gap: 10px;
  margin: 12px 0;
}

.hr-employee-directory-toolbar label,
.hr-employee-range-form label,
.hr-employee-profile-form label {
  display: grid;
  gap: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.hr-employee-directory-toolbar input,
.hr-employee-directory-toolbar select,
.hr-employee-range-form input,
.hr-employee-profile-form input,
.hr-employee-profile-form select,
.hr-employee-profile-form textarea {
  width: 100%;
  min-width: 0;
}

.hr-employee-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.hr-employee-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ui-border, var(--line));
  border-radius: 10px;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.hr-employee-card:hover,
.hr-employee-card.is-selected {
  border-color: rgba(20, 115, 255, 0.55);
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.1);
  transform: translateY(-1px);
}

.hr-employee-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #dbeafe, #e0f2fe);
  color: #075985;
  font-size: 14px;
  font-weight: 800;
}

.hr-employee-avatar.large {
  width: 52px;
  height: 52px;
  font-size: 17px;
}

.hr-employee-card-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.hr-employee-card-main > span,
.hr-employee-card-main > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-employee-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.hr-employee-card-title strong {
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-employee-dialog {
  width: min(1180px, calc(100vw - 24px));
  max-width: none;
  height: min(920px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.hr-employee-dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.hr-employee-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.hr-employee-dialog-header form {
  margin: 0;
}

.hr-employee-dialog-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.hr-employee-dialog-identity > div {
  min-width: 0;
}

.hr-employee-dialog-identity h2,
.hr-employee-dialog-identity p {
  overflow: hidden;
  margin: 2px 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-employee-dialog-identity h2 {
  color: #0f172a;
  font-size: 21px;
}

.hr-employee-dialog-identity p {
  color: var(--muted);
  font-size: 12px;
}

.hr-employee-range-form {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.hr-employee-range-form > span {
  align-self: center;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.hr-employee-range-form input {
  min-width: 145px;
}

.hr-employee-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  scrollbar-width: thin;
}

.hr-employee-detail-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
}

.hr-employee-detail-tabs button:hover {
  background: #f1f5f9;
}

.hr-employee-detail-tabs button.active {
  border-color: #bfdbfe;
  background: #e9f3ff;
  color: #075985;
}

.hr-employee-detail-tabs button:focus-visible,
.hr-employee-card button:focus-visible {
  outline: 3px solid rgba(20, 115, 255, 0.28);
  outline-offset: 2px;
}

.hr-employee-detail-status {
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
}

.hr-employee-detail-status.is-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff1f2;
  color: #be123c;
}

.hr-employee-detail {
  min-height: 0;
  padding: 16px 18px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}

.hr-employee-loading {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.hr-employee-loading span {
  width: 30px;
  height: 30px;
  border: 3px solid #dbeafe;
  border-top-color: #1473ff;
  border-radius: 50%;
  animation: hr-employee-spin 700ms linear infinite;
}

@keyframes hr-employee-spin {
  to { transform: rotate(360deg); }
}

.hr-employee-profile-form,
.hr-employee-tab-stack {
  display: grid;
  gap: 14px;
}

.hr-employee-profile-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.hr-employee-profile-form legend {
  padding: 0 6px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.hr-employee-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hr-employee-form-wide {
  grid-column: 1 / -1;
}

.hr-employee-form-check {
  align-content: end;
  min-height: 64px;
}

.hr-employee-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
}

.hr-employee-toggle-grid .check-row,
.hr-employee-form-check.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hr-employee-toggle-grid input,
.hr-employee-form-check input {
  width: auto;
}

.hr-employee-form-block {
  margin-top: 12px;
}

.hr-employee-save-panel {
  position: sticky;
  bottom: -22px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin: 0 -2px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px 10px 0 0;
  background: rgba(239, 246, 255, 0.97);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.hr-employee-save-panel > div {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.hr-employee-save-panel small {
  color: var(--muted);
}

.hr-employee-detail-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hr-employee-history-table table {
  min-width: 860px;
}

.hr-employee-history-table td {
  vertical-align: top;
}

.hr-employee-history-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.hr-attendance-create-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.hr-attendance-create-toolbar > div {
  display: grid;
  gap: 3px;
}

.hr-attendance-create-toolbar small {
  color: var(--muted);
}

.hr-attendance-time-editor-row > td {
  padding: 0 10px 14px;
  background: #f8fbff;
}

.hr-attendance-time-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.hr-attendance-create-form {
  background: #f8fbff;
}

.hr-leave-create-form {
  border-color: #a7f3d0;
  background: #f7fffb;
}

.hr-leave-create-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.hr-leave-create-fields label {
  display: grid;
  align-content: start;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.hr-leave-create-fields input,
.hr-leave-create-fields select,
.hr-leave-create-fields textarea {
  width: 100%;
  min-width: 0;
}

.hr-leave-create-fields label > small {
  color: var(--muted);
  font-weight: 500;
}

.hr-leave-create-wide {
  grid-column: 1 / -1;
}

.hr-leave-approval-confirm {
  padding: 11px 12px;
  border: 1px solid #f59e0b;
  border-radius: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
}

.hr-leave-approval-confirm[hidden] {
  display: none;
}

.hr-leave-approval-confirm .check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.hr-leave-approval-confirm input {
  width: auto;
  flex: none;
  margin-top: 2px;
}

.hr-attendance-time-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 12px;
}

.hr-attendance-create-fields {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.hr-attendance-time-fields label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.hr-attendance-time-fields input,
.hr-attendance-time-fields textarea {
  width: 100%;
  min-width: 0;
}

.hr-attendance-time-fields label > small,
.hr-attendance-overnight-option > small {
  color: var(--muted);
  font-weight: 500;
}

.hr-attendance-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 600;
}

.hr-attendance-time-fields .hr-attendance-checkbox-row input {
  width: auto;
  min-width: auto;
  margin: 0;
}

.hr-attendance-time-reason {
  grid-column: 1 / -1;
}

.hr-attendance-time-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hr-attendance-time-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hr-attendance-time-actions p.is-error {
  color: #b91c1c;
  font-weight: 700;
}

.hr-attendance-time-actions > div {
  display: flex;
  flex: none;
  gap: 8px;
}

.hr-employee-audit-list {
  display: grid;
  gap: 0;
}

.hr-employee-audit-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 18px;
}

.hr-employee-audit-item:not(:last-child)::before {
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: #dbeafe;
  content: "";
}

.hr-employee-audit-marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border: 3px solid #bfdbfe;
  border-radius: 50%;
  background: #1473ff;
}

.hr-employee-audit-item > div:last-child {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.hr-employee-audit-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hr-employee-audit-item time,
.hr-employee-audit-item p {
  color: var(--muted);
  font-size: 12px;
}

.hr-employee-audit-item p {
  margin: 4px 0 0;
}

.hr-employee-audit-changes {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.hr-employee-audit-changes > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.hr-employee-audit-changes dt {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.hr-employee-audit-changes dd {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  word-break: break-word;
}

.hr-employee-audit-changes dd span {
  color: #94a3b8;
  text-decoration: line-through;
}

.hr-employee-audit-changes dd b {
  color: #94a3b8;
}

@media (max-width: 760px) {
  .hr-employee-directory-toolbar,
  .hr-employee-form-grid,
  .hr-employee-save-panel {
    grid-template-columns: 1fr;
  }

  .hr-employee-directory {
    grid-template-columns: 1fr;
  }

  .hr-employee-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hr-employee-card > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hr-employee-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .hr-employee-dialog-header {
    align-items: flex-start;
    padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  }

  .hr-employee-dialog-identity {
    gap: 8px;
  }

  .hr-employee-avatar.large {
    width: 42px;
    height: 42px;
  }

  .hr-employee-dialog-identity h2 {
    font-size: 18px;
  }

  .hr-employee-dialog-identity > .usage-badge,
  .hr-employee-dialog-identity .hr-page-kicker {
    display: none;
  }

  .hr-employee-dialog-header form button {
    min-width: 62px;
    padding-inline: 9px;
  }

  .hr-employee-range-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px 12px;
  }

  .hr-employee-range-form > span,
  .hr-employee-range-form > button {
    grid-column: 1 / -1;
  }

  .hr-employee-range-form input {
    min-width: 0;
  }

  .hr-employee-detail-tabs {
    padding-inline: 8px;
  }

  .hr-employee-detail-tabs button {
    min-height: 42px;
  }

  .hr-employee-detail {
    padding: 12px 10px max(18px, env(safe-area-inset-bottom));
  }

  .hr-employee-profile-form fieldset {
    padding: 11px;
  }

  .hr-employee-form-wide {
    grid-column: auto;
  }

  .hr-employee-save-panel {
    bottom: calc(-1 * max(18px, env(safe-area-inset-bottom)));
  }

  .hr-employee-save-panel > div {
    justify-items: stretch;
  }

  .hr-employee-save-panel button {
    width: 100%;
  }

  .hr-employee-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-attendance-create-toolbar,
  .hr-attendance-time-actions {
    display: grid;
  }

  .hr-attendance-create-toolbar button {
    width: 100%;
  }

  .hr-attendance-time-fields,
  .hr-attendance-create-fields,
  .hr-leave-create-fields {
    grid-template-columns: 1fr;
  }

  .hr-attendance-time-reason,
  .hr-leave-create-wide {
    grid-column: auto;
  }

  .hr-attendance-time-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-employee-audit-item header,
  .hr-employee-audit-changes > div {
    grid-template-columns: 1fr;
  }

  .hr-employee-audit-item header {
    display: grid;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: var(--app-height, 100vh);
  height: var(--app-height, 100vh);
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, #8fb6ff 0%, #d9e7ff 48%, #f6fbff 100%);
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input,
select {
  min-height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 42px;
  max-height: 150px;
  padding: 10px 12px;
  overflow-y: auto;
  resize: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.ui-icon use {
  pointer-events: none;
}

.icon-button .ui-icon,
.rail-icon .ui-icon {
  pointer-events: none;
}

.auth-screen {
  min-height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(15, 118, 110, 0.12), transparent 35%),
    linear-gradient(320deg, rgba(37, 99, 235, 0.12), transparent 40%),
    var(--bg);
}

.auth-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-brand,
.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-row {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-brand {
  margin-bottom: 24px;
}

.auth-install-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 12px;
  background: #ecfdf5;
}

.auth-install-card strong,
.auth-install-card span {
  display: block;
}

.auth-install-card strong {
  color: #0f3f3b;
  font-size: 15px;
}

.auth-install-card span {
  margin-top: 3px;
  color: #526275;
  font-size: 13px;
  line-height: 1.5;
}

.install-link-button,
.sidebar-install-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  color: #0f766e;
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.install-link-button {
  width: 100%;
  color: #fff;
  border-color: #0f766e;
  background: #0f766e;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.auth-brand h1,
.auth-brand p,
.stack h2,
.chat-title-block h2,
.chat-title-block p {
  margin: 0;
}

.auth-brand p,
.chat-title-block p,
.brand-copy span,
.section-title,
.typing-line {
  color: var(--muted);
}

.stack,
.compact-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.primary,
.ghost,
.icon-button,
.tab {
  border: 1px solid transparent;
  border-radius: 7px;
}

.primary {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
}

.primary:hover {
  background: #0d625c;
}

.danger-lite {
  min-height: 38px;
  padding: 0 14px;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 7px;
  font-weight: 700;
}

.danger-lite:hover {
  background: #fecaca;
}

.primary:disabled,
.ghost:disabled,
.danger-lite:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ghost {
  min-height: 38px;
  padding: 0 12px;
  color: var(--accent);
  background: transparent;
  border-color: var(--line);
}

.ghost.active {
  background: #d7ebe7;
  border-color: rgba(15, 118, 110, 0.32);
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--text);
  background: #fff;
  border-color: var(--line);
  font-weight: 700;
  line-height: 1;
}

.icon-button:hover {
  background: var(--panel-2);
}

.icon-button.active {
  color: var(--accent);
  background: #d7ebe7;
  border-color: rgba(15, 118, 110, 0.32);
}

.notification-button.active {
  color: var(--accent);
  background: #d7ebe7;
  border-color: rgba(15, 118, 110, 0.32);
}

.notification-button.denied {
  color: var(--warning);
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.28);
}

.notification-center-button {
  position: relative;
}

.notification-center-button.has-unread::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
}

.app-shell {
  display: grid;
  height: 100vh;
  height: var(--app-height, 100dvh);
  min-height: 0;
  max-height: var(--app-height, 100dvh);
  grid-template-columns: 72px 300px minmax(360px, 1fr) 330px;
  padding: 18px;
  gap: 0;
  overflow: hidden;
}

.workspace-rail {
  display: grid;
  grid-template-rows: auto repeat(6, auto) 1fr auto;
  gap: 8px;
  justify-items: center;
  padding: 14px 8px;
  border-radius: 18px 0 0 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-right: 0;
  box-shadow: 0 18px 42px rgba(35, 74, 127, 0.14);
  backdrop-filter: blur(18px);
}

.rail-avatar,
.rail-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
}

.rail-avatar {
  justify-self: center;
  color: #fff;
  background: linear-gradient(145deg, #1473ff, #0f766e);
}

.rail-button {
  grid-template-columns: 1fr;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: #64748b;
  background: transparent;
  text-align: center;
}

.rail-button:hover,
.rail-button.active {
  color: #1473ff;
  background: #edf5ff;
}

.rail-icon {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: rgba(100, 116, 139, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.rail-button.active .rail-icon,
.rail-button:hover .rail-icon {
  background: #dbeafe;
}

.rail-label {
  display: none;
}

.rail-bottom {
  align-self: end;
}

.sidebar,
.context-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.context-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.sidebar {
  display: grid;
  grid-template-areas:
    "top"
    "tabs"
    "source"
    "search"
    "content";
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
}

.sidebar-top {
  grid-area: top;
}

.context-panel {
  border-radius: 0 18px 18px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-inspector {
  flex: 0 0 auto;
  display: grid;
  gap: 12px;
  max-height: 48vh;
  padding: 16px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.room-profile {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.room-profile-avatar {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg, #0f172a, #1473ff);
  box-shadow: 0 16px 32px rgba(20, 115, 255, 0.22);
  overflow: hidden;
}

.room-profile span,
.room-profile small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.room-member-strip {
  display: flex;
  justify-content: center;
  gap: 0;
  min-height: 32px;
}

.mini-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-left: -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  background: var(--accent-2);
}

.mini-avatar:first-child {
  margin-left: 0;
}

.mini-avatar.more {
  color: #1473ff;
  background: #e8f2ff;
}

.inspector-block {
  display: grid;
  gap: 8px;
}

.inspector-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.inspector-list {
  display: grid;
  gap: 6px;
}

.inspector-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
  text-decoration: none;
}

.inspector-item span:first-child {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #1473ff;
  background: #edf5ff;
  font-size: 11px;
  font-weight: 900;
}

.inspector-item strong,
.inspector-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounting-inspector {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
}

.accounting-inspector-head,
.accounting-document-title,
.accounting-document-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.accounting-inspector-head > div {
  display: grid;
  gap: 2px;
}

.accounting-inspector-head strong { color: #164788; }
.accounting-inspector-head span { color: #6d7f98; font-size: 0.72rem; }

.accounting-drive-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
}

.accounting-drive-status strong { grid-column: 1 / -1; }
.accounting-drive-status.ready { background: #e8f8ef; color: #14643b; }
.accounting-drive-status.attention { background: #fff4d8; color: #845400; }
.accounting-drive-status a { color: inherit; font-weight: 700; }

.accounting-warning {
  margin: 0;
  color: #7c5905;
  font-size: 0.72rem;
  line-height: 1.45;
}

.accounting-connect-drive { width: 100%; min-height: 34px; }

.accounting-counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.accounting-counts span {
  display: grid;
  justify-items: center;
  padding: 7px 2px;
  border: 1px solid #dbe7f8;
  border-radius: 10px;
  background: #fff;
  color: #6b7890;
  font-size: 0.62rem;
}

.accounting-counts b { color: #173a68; font-size: 0.9rem; }
.accounting-document-list { display: grid; gap: 8px; max-height: 390px; overflow: auto; }

.accounting-document-row {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid #d8e4f4;
  border-left: 4px solid #2c7df0;
  border-radius: 11px;
  background: #fff;
}

.accounting-document-row.review { border-left-color: #e29b19; }
.accounting-document-row.failed { border-left-color: #d64545; }
.accounting-document-row.duplicate { border-left-color: #8492a6; }
.accounting-document-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; }
.accounting-document-title span { flex: 0 0 auto; color: #52657e; font-size: 0.65rem; }
.accounting-document-row small { color: #687991; line-height: 1.35; }
.accounting-document-row p { margin: 0; color: #a03434; font-size: 0.68rem; line-height: 1.4; }
.accounting-document-actions { justify-content: flex-end; flex-wrap: wrap; }
.accounting-document-actions select { min-width: 120px; max-width: 100%; padding: 5px 7px; border: 1px solid #cbd8ea; border-radius: 8px; background: #fff; font-size: 0.68rem; }
.accounting-empty { padding: 14px 8px; color: #75869c; text-align: center; font-size: 0.75rem; }

.inspector-item small {
  color: var(--muted);
  font-size: 11px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.photo-thumb {
  overflow: hidden;
  aspect-ratio: 1.25;
  border-radius: 9px;
  background: #e2e8f0;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb.deferred-photo,
.deferred-image-preview {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 8px;
  border: 1px dashed #b6c7dc;
  color: #31506f;
  background: linear-gradient(135deg, #f7fbff, #e8eef6);
  text-align: center;
  text-decoration: none;
}

.photo-thumb.deferred-photo span,
.deferred-image-preview span {
  font-size: 12px;
  font-weight: 900;
}

.photo-thumb.deferred-photo small,
.deferred-image-preview small,
.deferred-image-preview em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.call-button {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.28);
  background: #ecfdf5;
}

.call-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(5px);
}

.call-panel[hidden] {
  display: none;
}

.call-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  width: min(440px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.25);
}

.call-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #1473ff);
  font-size: 22px;
  font-weight: 900;
}

.call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.call-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
}

.call-copy span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.call-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.call-actions button {
  min-height: 42px;
  border-radius: 12px;
}

.call-actions .danger,
.call-reject {
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.22);
  background: #fff5f5;
}

.call-accept {
  background: #0f766e;
}

.sidebar-top {
  display: grid;
  align-items: start;
  justify-content: stretch;
  gap: 12px;
  min-height: auto;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sidebar-top .brand-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-kicker {
  overflow: hidden;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

#current-user-line {
  display: block;
  position: relative;
  overflow: hidden;
  padding-left: 13px;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#current-user-line::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
}

.profile-name-button {
  justify-self: start;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  color: var(--accent);
  background: #edf8f6;
  font-size: 12px;
  font-weight: 800;
}

.profile-name-button:hover {
  border-color: rgba(15, 118, 110, 0.34);
  background: #dff3f0;
}

.profile-avatar-button {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #f3f7fb;
}

.profile-avatar-button .avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
}

.profile-camera {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  min-width: 24px;
  height: 18px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.profile-bio-trigger {
  cursor: pointer;
}

.profile-bio-trigger:hover {
  outline: 2px solid rgba(20, 115, 255, 0.28);
  outline-offset: 2px;
}

#profile-form button[type="submit"] {
  order: 20;
}

.brand-copy strong,
.conversation-name,
.person-name,
.message-author,
.task-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-actions,
.chat-header-actions {
  display: flex;
  gap: 6px;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.sidebar-actions .icon-button {
  width: 100%;
  min-width: 0;
  height: 40px;
  border-color: rgba(148, 163, 184, 0.22);
  background: #fff;
}

.sidebar-actions .mobile-panel-close {
  display: none;
}

.sidebar-install-link {
  width: 100%;
  min-height: 36px;
  border-style: dashed;
  background: #f8fbfd;
  font-size: 13px;
}

.sidebar-install-link:hover {
  border-style: solid;
  background: #ecfdf5;
}

.mobile-sidebar-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.mobile-sidebar-tab {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: #f3f7fb;
  font-size: 13px;
  font-weight: 800;
}

.mobile-sidebar-tab.active {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.28);
  background: #dff3f0;
}

.conversation-source-tabs {
  grid-area: source;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.conversation-source-tab {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.conversation-source-tab.active {
  color: #075985;
  border-color: rgba(20, 115, 255, 0.3);
  background: #eaf3ff;
}

.conversation-source-tab span {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  color: #075985;
  background: rgba(20, 115, 255, 0.14);
  font-size: 11px;
}

#mobile-people-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
}

.search-field {
  grid-area: search;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.conversation-list,
.people-list,
.member-list,
.task-list,
.admin-user-list,
.leave-list,
.search-results {
  overflow: auto;
  overscroll-behavior: contain;
}

.integration-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.integration-status {
  display: grid;
  gap: 8px;
}

.integration-state {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 7px;
  background: var(--panel-2);
}

.integration-state.ready {
  background: #d7ebe7;
}

.integration-state.pending {
  background: #fff7ed;
}

.integration-state.paused {
  background: #fee2e2;
}

.integration-state span,
.integration-steps,
.chat-id-list span,
.integration-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.integration-note {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  background: #fff;
}

#hr-v2-payroll-policy-note {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ai-settings-form {
  gap: 10px;
}

.knowledge-note-form {
  gap: 10px;
}

.knowledge-note-body,
.knowledge-note-form button[type="submit"] {
  grid-column: 1 / -1;
}

.knowledge-note-form textarea {
  min-height: 104px;
  max-height: 220px;
  resize: vertical;
}

.integration-steps {
  margin: 0;
  padding-left: 20px;
}

.integration-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-filter-tile {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.agent-filter-tile:hover,
.agent-filter-tile.active {
  border-color: #1473ff;
  background: #eff6ff;
}

.agent-filter-tile.active {
  box-shadow: inset 0 0 0 1px #1473ff;
}

.line-quality-card,
.line-followup-card,
.line-page-agent-card,
.line-page-agent-follow-card,
.agent-page-agent-card,
.agent-page-agent-follow-card,
.line-quality-dashboard,
.line-followup-dashboard,
.agent-dashboard {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.line-review-list,
.line-followup-list,
.agent-action-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.agent-follow-form,
.agent-follow-rule-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.agent-follow-form {
  padding: 10px;
  border: 1px solid rgba(20, 115, 255, 0.16);
  border-radius: 8px;
  background: #f8fbff;
}

.agent-secretary-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(20, 115, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.agent-secretary-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.agent-secretary-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-secretary-head strong,
.agent-secretary-head span,
.agent-secretary-preview-card strong,
.agent-secretary-preview-card span,
.agent-secretary-preview-card p,
.agent-secretary-preview-card small {
  overflow-wrap: anywhere;
}

.agent-secretary-head span,
.agent-secretary-preview-card small,
.agent-secretary-preview-card li,
.agent-secretary-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.agent-secretary-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
}

.agent-secretary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 10px;
  min-width: 0;
}

.agent-secretary-layout textarea {
  min-height: 96px;
}

.agent-secretary-layout select[multiple] {
  min-height: 132px;
  padding: 8px;
}

.agent-secretary-quick-actions,
.agent-secretary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.agent-secretary-actions {
  justify-content: flex-end;
}

.agent-secretary-preview {
  min-width: 0;
}

.agent-secretary-empty,
.agent-secretary-preview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #fff;
}

.agent-secretary-preview-card {
  border-style: solid;
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.agent-secretary-preview-card.scheduled {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.agent-secretary-preview-card header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.agent-secretary-preview-card header > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.agent-secretary-preview-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.agent-secretary-preview-card ul {
  margin: 0;
  padding-left: 18px;
}

.agent-secretary-history-card,
.agent-secretary-command-history {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.agent-secretary-history-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.agent-secretary-command-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}

.agent-secretary-command-card.scheduled {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.agent-secretary-command-card.cancelled {
  border-style: dashed;
  opacity: 0.72;
}

.agent-secretary-command-card.failed {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-secretary-command-card header,
.agent-secretary-command-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.agent-secretary-command-card header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-secretary-command-card strong,
.agent-secretary-command-card span,
.agent-secretary-command-card p,
.agent-secretary-command-card small {
  overflow-wrap: anywhere;
}

.agent-secretary-command-card p {
  margin: 0;
  line-height: 1.45;
}

.agent-secretary-command-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-secretary-command-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 800;
}

.agent-secretary-command-status.scheduled {
  background: #ccfbf1;
  color: #0f766e;
}

.agent-secretary-command-status.sent {
  background: #dcfce7;
  color: #15803d;
}

.agent-secretary-command-status.cancelled {
  background: #f1f5f9;
  color: #64748b;
}

.agent-secretary-command-status.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.agent-secretary-command-error {
  color: #b91c1c !important;
}

.agent-secretary-command-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.agent-follow-target-grid,
.agent-follow-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-follow-rule-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
}

.agent-follow-rule-card.paused {
  opacity: 0.66;
  border-style: dashed;
}

.agent-follow-rule-card header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.agent-follow-rule-card header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-follow-rule-card strong,
.agent-follow-rule-card span,
.agent-follow-rule-card small,
.agent-follow-rule-card p {
  overflow-wrap: anywhere;
}

.agent-follow-rule-card span,
.agent-follow-rule-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-follow-rule-card p {
  margin: 0;
  line-height: 1.45;
}

.agent-follow-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.agent-follow-status.active {
  background: #dcfce7;
  color: #047857;
}

.agent-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.agent-select-all,
.agent-card-select {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.agent-select-all input,
.agent-card-select input {
  width: 16px;
  height: 16px;
}

.agent-selected-count {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.agent-bulk-toolbar select {
  min-height: 32px;
  width: auto;
  min-width: 130px;
  max-width: 180px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.agent-bulk-toolbar select:disabled,
.agent-bulk-toolbar [data-agent-bulk-apply]:disabled {
  display: none;
}

.line-review-card,
.line-followup-case,
.agent-action-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.agent-action-card.selected {
  border-color: #1473ff;
  box-shadow: inset 0 0 0 1px #1473ff;
}

.agent-action-card.priority-urgent,
.agent-action-card.overdue {
  border-color: #fecaca;
  background: #fff7ed;
}

.agent-action-card.priority-hot {
  border-color: #fed7aa;
  background: #fffbeb;
}

.agent-action-card.priority-normal {
  border-color: #bfdbfe;
}

.line-review-card header,
.line-followup-case header,
.agent-action-card header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.agent-card-select {
  flex: 0 0 auto;
  min-height: 24px;
}

.agent-action-card header > div {
  flex: 1 1 auto;
}

.line-review-card header div,
.line-followup-case header div,
.agent-action-card header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-review-card header span,
.line-followup-case header span,
.agent-action-card header span,
.line-review-status,
.line-followup-due,
.line-followup-case small,
.agent-priority-chip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-priority-chip {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  white-space: nowrap;
}

.line-review-dialog p,
.line-followup-case p,
.agent-action-card p,
.line-review-note {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.agent-recommendation {
  padding: 8px 10px;
  border-left: 3px solid #14b8a6;
  background: #f0fdfa;
  color: #134e4a;
  font-size: 13px;
  line-height: 1.45;
}

.line-review-actions,
.line-followup-actions,
.agent-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.line-review-actions button,
.line-followup-actions button,
.agent-action-buttons button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.chat-id-list {
  display: grid;
  gap: 6px;
}

.chat-id-list > div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.chat-id-list code {
  overflow-wrap: anywhere;
}

.integration-error {
  padding: 8px;
  border-radius: 7px;
  color: #b91c1c;
  background: #fee2e2;
}

.conversation-list {
  grid-area: content;
  min-height: 0;
  padding: 8px;
}

.conversation-item,
.person-item,
.member-item,
.task-item,
.admin-user {
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.conversation-item:hover,
.person-item:hover {
  background: var(--panel-2);
}

.conversation-item.active {
  border-color: rgba(15, 118, 110, 0.3);
  background: rgba(15, 118, 110, 0.09);
}

.avatar {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent-2);
  overflow: hidden;
}

.avatar img,
.room-profile-avatar img,
.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.has-image {
  background: #dbeafe;
}

.avatar-initials {
  position: relative;
  z-index: 1;
}

.avatar.channel {
  color: var(--accent);
  background: #d7ebe7;
}

.status-dot {
  position: absolute;
  z-index: 2;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #9ca3af;
}

.status-dot.online {
  background: #16a34a;
}

.profile-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0f5132;
  background: #d7f6e4;
  font-size: 12px;
  font-weight: 800;
}

.profile-status-badge.busy {
  color: #7f1d1d;
  background: #fee2e2;
}

.profile-status-badge.meeting {
  color: #1d4ed8;
  background: #dbeafe;
}

.profile-status-badge.break {
  color: #854d0e;
  background: #fef3c7;
}

.profile-status-badge.away {
  color: #7c2d12;
  background: #ffedd5;
}

.profile-status-badge.leave {
  color: #4c1d95;
  background: #ede9fe;
}

.conversation-copy,
.person-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.conversation-meta,
.person-meta,
.message-time,
.task-meta,
.search-meta {
  color: var(--muted);
  font-size: 12px;
}

.conversation-meta {
  display: -webkit-box;
  overflow: hidden;
  max-height: 38px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.badge {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 12px;
  text-align: center;
}

.people-section {
  grid-area: content;
  min-height: 0;
  padding: 8px;
  border-top: 0;
  overflow: hidden;
}

.sidebar:not([data-mobile-mode]) .people-section,
.sidebar[data-mobile-mode="chats"] .people-section,
.sidebar[data-mobile-mode="people"] .conversation-list {
  display: none;
}

.sidebar[data-mobile-mode="people"] .conversation-source-tabs {
  display: none;
}

.sidebar[data-mobile-mode="people"] .people-section {
  display: flex;
  flex-direction: column;
}

.people-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sidebar-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.section-title {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-panel {
  position: relative;
  display: grid;
  height: 100%;
  min-height: 0;
  min-width: 0;
  grid-template-areas:
    "header"
    "search"
    "tasks"
    "messages"
    "typing"
    "files"
    "reply"
    "stickers"
    "composer"
    "progress"
    "mobile-nav";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto auto auto auto auto;
  overflow: hidden;
  background: rgba(247, 250, 255, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.68);
}

.drop-zone-hint {
  position: absolute;
  inset: 92px 18px 92px;
  z-index: 34;
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 180px;
  border: 2px dashed rgba(15, 118, 110, 0.48);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(240, 253, 250, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), var(--shadow);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: scale(0.985);
  transition: opacity 140ms ease, transform 140ms ease;
}

.drop-zone-hint strong {
  font-size: 18px;
}

.drop-zone-hint span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chat-panel.drag-over .drop-zone-hint {
  opacity: 1;
  transform: scale(1);
}

.chat-header {
  grid-area: header;
}

.room-task-strip {
  grid-area: tasks;
}

.room-search-panel {
  grid-area: search;
}

.messages {
  grid-area: messages;
}

.typing-line {
  grid-area: typing;
}

.selected-files {
  grid-area: files;
}

.reply-preview {
  grid-area: reply;
}

.sticker-panel {
  grid-area: stickers;
}

.mention-suggestions {
  position: absolute;
  left: 58px;
  right: 86px;
  bottom: 76px;
  z-index: 18;
  display: grid;
  gap: 6px;
  max-height: 236px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.mention-suggestions[hidden] {
  display: none;
}

.mention-suggestion {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.mention-suggestion:hover,
.mention-suggestion.active {
  background: #eaf3ff;
}

.mention-suggestion .avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.mention-suggestion strong,
.mention-suggestion span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-suggestion strong {
  font-size: 13px;
}

.mention-suggestion span {
  color: var(--muted);
  font-size: 12px;
}

.mention-token {
  display: inline-block;
  padding: 0 4px;
  border-radius: 6px;
  color: #0b63ce;
  background: #eaf3ff;
  font-weight: 800;
}

.message.own .mention-token {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.message.mentioned-message .message-bubble {
  box-shadow: 0 0 0 3px rgba(20, 115, 255, 0.14), 0 10px 26px rgba(20, 115, 255, 0.12);
}

.composer {
  grid-area: composer;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.upload-progress {
  grid-area: progress;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.mobile-chat-nav {
  grid-area: mobile-nav;
  display: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.chat-panel.attention-pulse {
  animation: chat-attention-pulse 1.6s ease-out;
}

@keyframes chat-attention-pulse {
  0% {
    box-shadow: inset 0 0 0 0 rgba(15, 118, 110, 0);
  }
  18% {
    box-shadow: inset 0 0 0 5px rgba(15, 118, 110, 0.46);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(15, 118, 110, 0);
  }
}

.chat-title-block {
  min-width: 0;
}

.chat-title-block h2 {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-task-strip {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.room-search-panel {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.room-search-panel[hidden] {
  display: none;
}

.room-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px 34px 34px;
  gap: 8px;
  align-items: center;
}

.room-search-bar input {
  min-height: 38px;
}

.room-search-count {
  min-width: 46px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.room-search-results {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.room-search-result {
  display: grid;
  flex: 0 0 min(360px, 82vw);
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #f8fbfd;
  text-align: left;
}

.room-search-result.active {
  border-color: rgba(20, 115, 255, 0.42);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(20, 115, 255, 0.12);
}

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

.room-search-result span,
.room-search-empty {
  color: var(--muted);
  font-size: 12px;
}

.room-search-result mark {
  border-radius: 4px;
  color: #7c2d12;
  background: #fed7aa;
}

.room-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room-task-head strong {
  color: var(--accent);
  font-size: 13px;
}

.room-task-head button {
  min-height: 30px;
  padding: 0 10px;
}

.room-task-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.task-scope-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.task-scope {
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.task-scope.active {
  border-color: transparent;
  color: var(--accent);
  background: #e5f3f0;
}

.task-scope:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.55;
}

.room-task-chip {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 8px;
  align-items: center;
  flex: 0 0 min(360px, 86vw);
  padding: 8px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 7px;
  background: #eef8f6;
}

.room-task-chip strong,
.room-task-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-task-chip strong {
  font-size: 13px;
}

.room-task-chip span {
  color: var(--muted);
  font-size: 12px;
}

.room-task-chip button {
  min-height: 34px;
  padding: 0 12px;
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scrollbar-gutter: stable;
  background: #eef4f5;
}

.empty-state {
  display: grid;
  height: 100%;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.message {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin: 0 0 10px;
  overflow: visible;
}

.message.own {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.message.other {
  justify-items: start;
}

.message.system-message {
  display: flex;
  justify-content: center;
}

.message-bubble {
  position: relative;
  min-width: 0;
  max-width: min(680px, 76%);
  overflow: visible;
  padding: 10px 13px;
  border: 0;
  border-radius: 18px 18px 18px 5px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 33, 31, 0.08);
}

.message.own .message-bubble {
  border-radius: 18px 18px 5px 18px;
  color: #fff;
  background: linear-gradient(135deg, #1473ff, #0f8fff);
}

.message.message-deleted .message-bubble,
.message.own.message-deleted .message-bubble {
  border: 1px dashed #cbd5e1;
  color: #64748b;
  background: #f8fafc;
  box-shadow: none;
}

.message-deleted-text {
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
}

.message.ai-answer-message .message-bubble {
  max-width: min(760px, 82%);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--text);
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.message.ai-answer-message .message-text {
  white-space: pre-wrap;
}

.message.own .message-time,
.message.own .message-author,
.message.own .conversation-meta,
.message.own .read-receipt {
  color: rgba(255, 255, 255, 0.82);
}

.message.pinned-message .message-bubble {
  box-shadow: 0 10px 26px rgba(20, 115, 255, 0.16);
}

.message-highlight .message-bubble {
  animation: message-highlight 1.3s ease;
}

@keyframes message-highlight {
  0%, 100% { box-shadow: 0 1px 2px rgba(18, 33, 31, 0.08); }
  35% { box-shadow: 0 0 0 4px rgba(20, 115, 255, 0.22), 0 14px 32px rgba(20, 115, 255, 0.2); }
}

.message-actions {
  position: absolute;
  top: -18px;
  right: 10px;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  z-index: 2;
}

.message.other .message-actions {
  left: 10px;
  right: auto;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  display: flex;
}

.message-actions button,
.message-reactions button {
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.message-actions button {
  min-width: 28px;
  height: 28px;
  color: #334155;
}

.message-actions button:hover,
.message-reactions button:hover,
.message-reactions button.mine {
  background: #eaf2ff;
}

.message-actions .danger-message-action {
  color: #b91c1c;
}

.message-actions .danger-message-action:hover {
  background: #fee2e2;
}

.reaction-quick {
  display: inline-flex;
  gap: 1px;
  padding-left: 3px;
  border-left: 1px solid var(--line);
}

.reply-quote {
  display: grid;
  width: 100%;
  gap: 2px;
  margin: 4px 0 7px;
  padding: 7px 9px;
  border: 0;
  border-left: 3px solid rgba(20, 115, 255, 0.75);
  border-radius: 7px;
  color: inherit;
  background: rgba(15, 23, 42, 0.06);
  text-align: left;
}

.message.own .reply-quote {
  border-left-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.16);
}

.reply-quote strong,
.reply-quote span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote span {
  color: var(--muted);
  font-size: 12px;
}

.message.own .reply-quote span {
  color: rgba(255, 255, 255, 0.78);
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.message-reactions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #334155;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.pin-mark {
  font-size: 11px;
}

.message.system-message .message-bubble {
  max-width: min(520px, 88%);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  text-align: center;
  box-shadow: none;
}

.message.claim-notification-message .message-bubble {
  width: fit-content;
  max-width: min(480px, 76%);
  padding: 10px 12px;
  overflow: visible;
  border: 1px solid rgba(207, 224, 243, 0.95);
  border-radius: 15px;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, #f9fcff);
  text-align: left;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.message.claim-notification-message .message-row {
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 0;
}

.message.claim-notification-message .message-time {
  color: #64748b;
  font-size: 11px;
}

.claim-notification-text {
  min-width: 0;
}

.claim-notification-card {
  padding: 0;
}

.claim-card-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 0 6px;
  border-bottom: 1px solid #e5edf5;
}

.claim-card-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: #0f766e;
  background: #dcf7ee;
  font-size: 12px;
  font-weight: 900;
}

.claim-card-heading-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.claim-card-heading-text strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
}

.claim-evidence-preview-wrap {
  display: grid;
  gap: 6px;
  margin: 8px 0 7px;
}

.claim-evidence-preview {
  position: relative;
  display: block;
  width: min(320px, 100%);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  background: #f1f5f9;
  text-decoration: none;
}

.claim-evidence-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.claim-evidence-preview span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.claim-evidence-open-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #bfe4dc;
  border-radius: 999px;
  color: #0f766e;
  background: #ecfdf7;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.claim-evidence-preview-wrap.is-unavailable .claim-evidence-preview {
  display: none;
}

.claim-card-fields {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
}

.claim-card-row {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.claim-card-row dt,
.claim-card-row dd {
  min-width: 0;
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.claim-card-row dt {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.claim-card-row dd {
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.claim-card-row dd a,
.claim-card-note a {
  color: #0f766e;
  font-weight: 800;
}

.claim-card-note {
  padding: 0;
  border-radius: 0;
  color: #334155;
  background: transparent;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.message-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.read-receipt {
  font-size: 11px;
  font-weight: 700;
}

.read-receipt.read {
  color: var(--accent);
}

.read-receipt.unread {
  color: var(--muted);
}

.message.own .message-row {
  justify-content: flex-end;
}

.message-author {
  color: var(--accent);
  font-size: 12px;
}

.message-date-divider {
  display: table;
  margin: 10px auto 14px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.message-window-notice {
  width: min(520px, calc(100% - 24px));
  margin: 8px auto 14px;
  padding: 8px 12px;
  border: 1px solid rgba(20, 115, 255, 0.18);
  border-radius: 999px;
  color: #2f5b8d;
  background: #eef6ff;
  font-size: 12px;
  text-align: center;
}

.load-older-messages {
  align-self: center;
  margin: 8px auto 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f766e;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.load-older-messages:disabled {
  opacity: 0.6;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.48;
}

.message-sticker-text {
  padding: 4px 2px;
  white-space: pre-wrap;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}

.message-text a {
  color: var(--accent-2);
}

.message.own .message-text a {
  color: #155e75;
}

.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.image-preview-link {
  display: block;
  flex: none;
  width: clamp(140px, 24vw, 260px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.image-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.deferred-image-preview {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: auto;
}

.file-card > div {
  min-width: 0;
  flex: 1 1 auto;
}

.file-card strong {
  display: block;
  overflow: hidden;
  max-width: 380px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card.image-file-card > div,
.line-inbox-file-card.image-file-card > div {
  min-height: 0;
}

.file-card a,
.search-result a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.album-card {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.message.own .album-card {
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
}

.album-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.album-card-head div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.album-card-head strong,
.album-card-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card-head span,
.album-downloads span {
  color: var(--muted);
  font-size: 12px;
}

.album-share-button {
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.album-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  border-radius: 9px;
}

.album-photo-grid.count-1 {
  grid-template-columns: minmax(0, 1fr);
}

.album-photo-grid.count-2,
.album-photo-grid.count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.album-photo {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e2e8f0;
}

.album-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-photo .album-photo-placeholder {
  gap: 3px;
  color: #31506f;
  background: linear-gradient(135deg, #f7fbff, #e8eef6);
  font-size: 12px;
}

.album-photo .album-photo-placeholder strong,
.album-photo .album-photo-placeholder small {
  line-height: 1.15;
}

.album-photo .album-photo-placeholder small {
  color: var(--muted);
  font-size: 10px;
}

.album-photo span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.58);
  font-size: 22px;
  font-weight: 900;
}

.album-photo span.album-photo-placeholder {
  gap: 3px;
  color: #31506f;
  background: linear-gradient(135deg, #f7fbff, #e8eef6);
  font-size: 12px;
}

.album-photo span.album-photo-placeholder small {
  color: var(--muted);
  font-size: 10px;
}

.album-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.album-downloads a {
  max-width: 180px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: #e5f3f0;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typing-line {
  flex: none;
  min-height: 24px;
  padding: 0 18px 6px;
  font-size: 13px;
}

.selected-files {
  display: grid;
  flex: none;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.selected-files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.album-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 999px;
  color: var(--accent);
  background: #e5f3f0;
  font-size: 13px;
  font-weight: 800;
}

.album-toggle input {
  width: 16px;
  min-height: 16px;
}

.selected-file-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.selected-file-grid.album-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  overflow: visible;
}

.reply-preview {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: #f7fbff;
}

.reply-preview div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.reply-preview strong,
.reply-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview span {
  color: var(--muted);
  font-size: 12px;
}

.sticker-panel {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.sticker-panel section {
  display: grid;
  gap: 8px;
}

.sticker-panel strong {
  color: var(--muted);
  font-size: 12px;
}

.sticker-panel strong span {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #0f766e;
  background: #d7ebe7;
  font-size: 11px;
}

.admin-sticker-section {
  padding: 10px;
  border: 1px solid rgba(20, 115, 255, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef7ff 100%);
}

.sticker-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sticker-grid button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
}

.admin-sticker-section .sticker-grid button {
  border-color: rgba(20, 115, 255, 0.28);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 115, 255, 0.08);
}

.admin-sticker-section .sticker-grid button:hover {
  border-color: rgba(20, 115, 255, 0.55);
  background: #edf5ff;
}

.emoji-grid button {
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.sticker-shortcuts button {
  padding: 0 14px;
  color: var(--text);
  font-weight: 700;
}

.selected-file {
  display: grid;
  grid-template-columns: 46px minmax(120px, 220px) auto;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 250px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.selected-file img,
.file-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 6px;
  background: #fff;
}

.selected-file img {
  object-fit: cover;
  border: 1px solid var(--line);
}

.file-icon {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.selected-file strong,
.selected-file span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.selected-file-grid.album-mode .selected-file {
  grid-template-columns: 1fr auto;
  align-items: start;
  min-width: 0;
  padding: 5px;
}

.selected-file-grid.album-mode .selected-file img {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.selected-file-grid.album-mode .selected-file div {
  min-width: 0;
}

.selected-file-grid.album-mode .selected-file strong {
  max-width: 100%;
  font-size: 12px;
}

.selected-file-grid.album-mode .selected-file .icon-button {
  width: 28px;
  height: 28px;
}

.composer {
  display: grid;
  flex: none;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.composer textarea {
  border-radius: 18px;
  background: #f3f6fa;
}

.send-button {
  width: 70px;
  border-radius: 16px;
  background: #1473ff;
}

.mobile-hr-shortcut,
.mobile-admin-shortcut {
  min-width: 46px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.mobile-admin-shortcut {
  min-width: 62px;
  color: var(--accent);
  background: #edf5ff;
  border-color: rgba(20, 115, 255, 0.28);
}

.mobile-chat-nav {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.mobile-chat-nav button {
  min-width: 58px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-chat-nav button.active,
.mobile-chat-nav button:active {
  color: var(--accent);
  background: #e9f7f5;
}

.upload-progress {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: center;
  padding: 8px 14px 12px;
  color: var(--muted);
  background: var(--panel);
}

.upload-progress progress {
  width: 100%;
}

.tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  color: var(--text);
  background: var(--panel-2);
}

.context-tab {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.context-tab.active {
  display: block;
}

.compact-form {
  margin-bottom: 14px;
}

.task-help-card {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: #f4f7ff;
}

.task-help-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.task-item,
.admin-user,
.member-item,
.leave-item {
  margin-bottom: 8px;
  border-color: var(--line);
  background: #fff;
}

.task-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.task-actions {
  display: flex;
  gap: 6px;
  justify-content: end;
}

.task-delete {
  color: var(--danger);
}

.member-form[hidden] {
  display: none;
}

.member-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.admin-user {
  grid-template-columns: auto minmax(0, 1fr) auto minmax(130px, 170px) minmax(140px, 180px) repeat(4, auto);
}

.member-remove {
  color: var(--danger);
}

.admin-user-toggle {
  min-height: 32px;
  white-space: nowrap;
}

.admin-position-select,
.admin-manager-select {
  min-width: 140px;
}

.position-settings-form textarea {
  min-height: 210px;
  max-height: 320px;
  resize: vertical;
}

.tiny-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.knowledge-file-list,
.notification-center-list {
  display: grid;
  gap: 8px;
}

.knowledge-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.knowledge-file strong,
.knowledge-file span,
.knowledge-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-file span,
.knowledge-file small {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-file-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) auto auto;
  gap: 6px;
  align-items: center;
}

.knowledge-file-controls select {
  min-width: 0;
  height: 34px;
  font-size: 12px;
}

.notification-modal {
  width: min(560px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 0;
  overflow: hidden;
}

.notification-body {
  box-sizing: border-box;
  width: 100%;
  max-height: min(720px, calc(100dvh - 24px));
  overflow: hidden;
}

.notification-body header,
.notification-body header > div {
  min-width: 0;
}

.notification-body h2,
.notification-body header p {
  overflow-wrap: anywhere;
}

.notification-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
  background: var(--panel);
  overflow: hidden;
  white-space: normal;
}

.notification-row.unread {
  border-color: rgba(15, 118, 110, 0.28);
  background: #eef8f6;
}

.notification-row span,
.notification-row small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.notification-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.notification-center-list {
  max-height: min(560px, calc(100dvh - 190px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 2px 0;
}

.notification-row small {
  font-size: 12px;
}

.audit-log-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 2px;
}

.audit-log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  display: grid;
  gap: 5px;
}

.audit-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-log-head span,
.audit-log-item small {
  color: var(--muted);
  font-size: 12px;
}

.audit-log-item p {
  margin: 0;
  line-height: 1.45;
}

.split-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.split-status-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.danger-action {
  color: var(--danger);
  border-color: rgba(185, 28, 28, 0.28);
}

.active-action {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.34);
  background: #eef8f6;
}

.full-width {
  width: 100%;
  margin: 0 0 12px;
}

.task-item.done {
  opacity: 0.68;
}

.task-item.done .task-title {
  text-decoration: line-through;
}

.routine-reminder-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: #f5fbfa;
}

.routine-reminder-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.form-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.form-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.routine-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.routine-submit {
  width: 100%;
  min-height: 42px;
}

.routine-reminder-list {
  display: grid;
  gap: 8px;
}

.routine-reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.routine-reminder-item.paused {
  opacity: 0.66;
}

.routine-reminder-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.routine-reminder-main strong,
.routine-reminder-main span,
.routine-reminder-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-reminder-main span,
.routine-reminder-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.muted-pill {
  color: var(--muted);
  background: var(--panel-2);
}

.task-check {
  width: 18px;
  height: 18px;
}

.role-pill {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: #d7ebe7;
  font-size: 12px;
  font-weight: 700;
}

.hr-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.hr-filter-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  margin-bottom: 12px;
}

.hr-filter-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.hr-section-title {
  margin: 14px 0 8px;
}

.leave-overview,
.leave-summary {
  display: grid;
  gap: 10px;
}

.leave-employee-report {
  display: grid;
  gap: 12px;
}

.leave-report-profile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.leave-report-profile > div {
  min-width: 0;
}

.leave-report-profile strong,
.leave-report-profile span {
  display: block;
  overflow-wrap: anywhere;
}

.leave-report-profile span {
  color: var(--muted);
  font-size: 12px;
}

.leave-report-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.leave-report-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.leave-report-type-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.leave-report-type-card span,
.leave-report-type-card small {
  color: var(--muted);
  font-size: 12px;
}

.leave-report-type-card strong {
  font-size: 16px;
}

.leave-report-table table {
  min-width: 760px;
}

.leave-report-table td strong,
.leave-report-table td small {
  display: block;
}

.leave-report-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.leave-summary-report-button {
  justify-self: stretch;
}

.hr-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hr-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

button.hr-metric {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

button.hr-metric:hover {
  border-color: rgba(20, 115, 255, 0.35);
  background: #f8fbff;
}

.hr-metric span,
.policy-note,
.leave-total-line,
.leave-type-meter small {
  color: var(--muted);
  font-size: 12px;
}

.hr-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.metric-alert {
  border-color: rgba(185, 28, 28, 0.32);
  background: #fff1f1;
}

.policy-note {
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  line-height: 1.45;
}

.leave-pending-year-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f3c76b;
  border-radius: 9px;
  color: #713f12;
  background: #fff8e6;
}

.leave-pending-year-notice > div {
  min-width: 0;
}

.leave-pending-year-notice strong,
.leave-pending-year-notice span {
  display: block;
  overflow-wrap: anywhere;
}

.leave-pending-year-notice span {
  margin-top: 3px;
  font-size: 12px;
}

.leave-pending-year-notice button {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .leave-pending-year-notice {
    align-items: stretch;
    flex-direction: column;
  }
}

.wide-control {
  margin-bottom: 12px;
}

.leave-list {
  display: grid;
  gap: 10px;
}

.leave-item {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.leave-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.leave-head strong,
.leave-head span,
.leave-meta span,
.leave-note {
  overflow-wrap: anywhere;
}

.leave-head > div {
  min-width: 0;
}

.leave-head strong {
  display: block;
}

.leave-head span,
.leave-meta,
.leave-note {
  color: var(--muted);
  font-size: 12px;
}

.leave-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.leave-item p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.leave-note {
  padding: 8px;
  border-radius: 7px;
  background: var(--panel-2);
}

.leave-note-input {
  min-height: 62px;
}

.leave-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.leave-summary-item {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.leave-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.leave-summary-head > div {
  min-width: 0;
}

.leave-summary-head strong,
.leave-summary-head span,
.leave-total-line,
.meter-title span {
  overflow-wrap: anywhere;
}

.leave-summary-head strong {
  display: block;
}

.leave-summary-head span {
  color: var(--muted);
  font-size: 12px;
}

.usage-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.usage-badge.ok {
  color: var(--accent);
  background: #d7ebe7;
}

.usage-badge.near {
  color: #9a3412;
  background: #ffedd5;
}

.usage-badge.over {
  color: #b91c1c;
  background: #fee2e2;
}

.leave-type-grid {
  display: grid;
  gap: 8px;
}

.leave-type-meter {
  display: grid;
  gap: 5px;
}

.meter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.meter-title strong {
  flex: 0 0 auto;
}

.meter-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.leave-type-meter.near .meter-track span {
  background: #f97316;
}

.leave-type-meter.over .meter-track span {
  background: #dc2626;
}

.leave-approved {
  border-color: rgba(15, 118, 110, 0.28);
}

.leave-rejected {
  border-color: rgba(185, 28, 28, 0.24);
}

.compact-empty {
  min-height: 160px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-page,
.line-page,
.line-auto-reply-page,
.agent-page,
.broadcast-page,
.content-report-page,
.hr-page,
.admin-page,
.crm-page {
  grid-column: 3 / 5;
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid var(--line);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.96);
}

.app-shell.home-mode .chat-panel,
.app-shell.home-mode .context-panel,
.app-shell.line-mode .chat-panel,
.app-shell.line-mode .context-panel,
.app-shell.line-auto-reply-mode .chat-panel,
.app-shell.line-auto-reply-mode .context-panel,
.app-shell.agent-mode .chat-panel,
.app-shell.agent-mode .context-panel,
.app-shell.content-report-mode .chat-panel,
.app-shell.content-report-mode .context-panel,
.app-shell.hr-mode .chat-panel,
.app-shell.hr-mode .context-panel {
  display: none;
}

.app-shell.broadcast-mode .chat-panel,
.app-shell.broadcast-mode .context-panel {
  display: none;
}

.app-shell.admin-mode .chat-panel,
.app-shell.admin-mode .context-panel {
  display: none;
}

.app-shell.crm-mode .chat-panel,
.app-shell.crm-mode .context-panel {
  display: none;
}

.workspace-page-header,
.hr-page-header,
.admin-page-header,
.crm-page-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.workspace-page-header h2,
.workspace-page-header p,
.hr-page-header h2,
.hr-page-header p,
.admin-page-header h2,
.admin-page-header p,
.crm-page-header h2,
.crm-page-header p {
  margin: 0;
}

.workspace-page-header h2,
.hr-page-header h2,
.admin-page-header h2,
.crm-page-header h2 {
  font-size: 24px;
}

.workspace-page-header p,
.workspace-page-kicker,
.hr-page-header p,
.hr-page-kicker,
.admin-page-header p,
.admin-page-kicker,
.crm-page-header p,
.crm-page-kicker {
  color: var(--muted);
}

.workspace-page-kicker,
.hr-page-kicker,
.admin-page-kicker,
.crm-page-kicker {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-page-actions,
.hr-page-actions,
.admin-page-actions,
.crm-page-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.today-metrics,
.content-report-page > .dashboard-metrics {
  padding: 16px 20px 0;
}

.today-priority-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 20px 20px;
}

.workspace-page-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workspace-page-card.focus-pulse {
  border-color: #1473ff;
  box-shadow: 0 0 0 3px rgba(20, 115, 255, 0.16);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.google-drive-picker {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid rgba(20, 115, 255, 0.18);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.google-drive-picker[hidden] {
  display: none;
}

.google-drive-picker-head,
.google-drive-picker-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.google-drive-picker-head strong {
  color: var(--text);
  font-size: 13px;
}

.google-drive-picker-search input {
  flex: 1;
}

.google-drive-picker > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.google-drive-direct-resolve {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(20, 115, 255, 0.24);
  border-radius: 10px;
  background: #eff6ff;
}

.google-drive-direct-resolve strong,
.google-drive-direct-resolve small {
  display: block;
}

.google-drive-direct-resolve small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.google-drive-picker-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.google-drive-file-option {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.google-drive-file-option:hover,
.google-drive-file-option:focus-visible {
  border-color: rgba(20, 115, 255, 0.55);
  background: #eff6ff;
}

.google-drive-file-option img,
.google-drive-file-option > span {
  width: 100%;
  aspect-ratio: 1.5 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
}

.google-drive-file-option strong,
.google-drive-file-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-drive-file-option small {
  color: var(--muted);
  font-size: 11px;
}

.drive-page {
  grid-column: 3 / 5;
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid var(--line);
  border-radius: 0 18px 18px 0;
  background: rgba(248, 251, 255, 0.86);
}

.app-shell.drive-mode .chat-panel,
.app-shell.drive-mode .context-panel {
  display: none;
}

.drive-page-header {
  flex: 0 0 auto;
}

.drive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 20px 0;
}

.drive-breadcrumbs {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.drive-breadcrumbs button {
  max-width: 220px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-breadcrumbs button.active {
  color: var(--oc-primary);
  border-color: rgba(20, 115, 255, 0.32);
  background: #eff6ff;
}

.drive-breadcrumbs .drive-breadcrumb-up {
  flex: 0 0 auto;
  color: #0f5ec7;
  border-color: rgba(20, 115, 255, 0.35);
  background: #f4f8ff;
  font-weight: 800;
}

.drive-breadcrumbs .drive-breadcrumb-up:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: #f8fafc;
}

.drive-breadcrumbs > span[aria-hidden="true"] {
  color: #94a3b8;
  font-weight: 800;
}

.drive-actions {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 8px;
  align-items: center;
}

.drive-actions input {
  min-height: 38px;
}

.drive-status {
  flex: 0 0 auto;
  padding: 12px 20px 0;
}

.drive-summary,
.drive-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 115, 255, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
}

.drive-summary span {
  color: var(--text);
  font-weight: 800;
}

.drive-summary strong {
  color: var(--oc-primary);
  font-size: 20px;
}

.drive-write-note {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: 8px;
  color: #7c2d12;
  background: #fff7ed;
}

.drive-write-note strong {
  font-size: 13px;
}

.drive-write-note span {
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.drive-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
}

.drive-progress progress {
  width: 100%;
  height: 10px;
}

.drive-file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 14px 20px 24px;
}

.drive-file-list .empty-state {
  grid-column: 1 / -1;
}

.drive-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--oc-border, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--oc-shadow-sm, 0 10px 24px rgba(15, 23, 42, 0.06));
}

.drive-file-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 68px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.drive-file-main:hover strong,
.drive-file-main:focus-visible strong {
  color: var(--oc-primary);
}

.drive-file-main img,
.drive-file-icon {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf4ff;
  object-fit: cover;
}

.drive-file-icon {
  display: grid;
  place-items: center;
  color: var(--oc-primary);
  font-size: 12px;
  font-weight: 900;
}

.drive-file-main strong,
.drive-file-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-file-main strong {
  margin-bottom: 4px;
  white-space: nowrap;
}

.drive-file-main small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.drive-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tiny-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.tiny-button.primary {
  border-color: var(--oc-primary);
  color: #fff;
  background: var(--oc-primary);
}

.tiny-button.ghost {
  color: var(--oc-primary);
  background: #eff6ff;
}

@media (max-width: 1180px) {
  .drive-page {
    grid-column: 3;
  }

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

  .drive-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  #line-page .line-page-header {
    position: relative !important;
    top: auto !important;
  }

  #line-page .line-page-status,
  #line-page .line-status-strip,
  #line-page .line-page-grid,
  #line-page .line-page-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  #line-page .line-page-status {
    overflow: hidden;
  }

  #line-page .line-status-strip {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #line-page .line-page-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
  }

  #line-page .dashboard-table-scroll {
    max-width: 100%;
    overflow-x: auto;
  }

  .app-shell.drive-mode {
    grid-template-columns: 1fr;
  }

  .app-shell.drive-mode .sidebar,
  .app-shell.drive-mode .chat-panel,
  .app-shell.drive-mode .context-panel {
    display: none;
  }

  .drive-page {
    grid-column: 1;
    width: var(--app-width, 100vw);
    height: var(--app-height, 100vh);
    max-height: var(--app-height, 100vh);
    border: 0;
    border-radius: 0;
  }

  .drive-toolbar,
  .drive-status,
  .drive-file-list {
    margin-inline: 10px;
    padding-inline: 0;
  }

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

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

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

.today-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.today-attendance-panel {
  grid-column: 1 / -1;
}

.today-attendance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.today-attendance-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.today-attendance-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.today-attendance-help span {
  min-width: min(100%, 420px);
}

.today-qr-request {
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-qr-request button {
  min-width: 110px;
}

.today-qr-request span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.today-qr-preview {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #ecfdf5;
}

.today-qr-image {
  display: grid;
  place-items: center;
  min-height: 74px;
  border-radius: 6px;
  background: #fff;
}

.today-qr-image svg {
  width: 68px;
  height: 68px;
}

.today-qr-preview span,
.today-qr-preview small {
  display: block;
  color: #0f766e;
  font-size: 12px;
}

.today-qr-preview strong {
  display: block;
  margin: 2px 0;
  word-break: break-all;
}

.today-qr-actions,
.hr-v2-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.today-qr-actions button,
.hr-v2-qr-actions button {
  min-height: 34px;
}

.today-panel-title {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.today-panel-title:hover {
  color: var(--accent);
}

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

.today-row {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 54px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.today-row:hover {
  border-color: rgba(20, 115, 255, 0.32);
  background: #f8fbff;
}

.today-row.alert {
  border-color: rgba(185, 28, 28, 0.18);
  background: #fff7f7;
}

.today-row strong,
.today-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-row span {
  color: var(--muted);
  font-size: 12px;
}

.today-content-summary,
.line-status-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.today-content-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.today-content-open {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.today-content-open:hover div {
  border-color: rgba(20, 115, 255, 0.32);
  background: #f8fbff;
}

.today-content-summary div,
.line-status-strip div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.today-content-summary div.alert,
.line-status-strip div.pending {
  border-color: rgba(217, 119, 6, 0.24);
  background: #fff7ed;
}

.today-content-summary span,
.line-status-strip span,
.line-status-strip small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.today-content-summary strong,
.line-status-strip strong {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * LINE Workspace Stability Pass 1 (composer visibility):
 * In normal (non-focus) mode the inbox sat above a tall dashboard on a
 * scrollable page, so on shorter viewports the reply composer fell BELOW the
 * fold (measured: composer top y=836 on a 751px viewport). Pin the inbox to the
 * viewport height so the composer is always visible; on tall screens it keeps
 * the original 620px. The dashboard below stays reachable by scrolling.
 */
#line-page:not(.line-focus-mode) .line-inbox-workspace {
  flex: 0 0 auto;
  height: min(620px, calc(100dvh - 264px));
  min-height: 380px;
}

/*
 * LINE Workspace Stability Pass 1 (collapsible side panels):
 * The toolbar "ซ่อนรายชื่อ"/"ซ่อนรายละเอียด" buttons toggle these classes so
 * the chat panel takes the freed width. Scoped to #line-page so they win over
 * the focus-mode grid-template-columns override too.
 */
/* Pin each panel to its column so hiding a neighbour (display:none) does not let
 * grid auto-placement pull the chat panel into the collapsed 0px column. */
.line-inbox-list-panel { grid-column: 1; }

.agent-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  align-items: start;
  gap: 14px;
  padding: 16px 20px 20px;
  min-height: 0;
}

.agent-secretary-chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: clamp(360px, calc(var(--app-height, 100dvh) - 168px), 760px);
  min-height: 0;
  overflow: hidden;
}

.agent-tool-panel {
  display: grid;
  align-self: start;
  gap: 12px;
  min-width: 0;
  max-height: calc(var(--app-height, 100dvh) - 150px);
  overflow: auto;
  overscroll-behavior: contain;
}

.agent-tool-panel > [hidden] {
  display: none !important;
}

.agent-tool-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.agent-tool-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.agent-tool-tabs button.active {
  border-color: rgba(20, 115, 255, 0.42);
  color: #0f5fd7;
  background: #eaf3ff;
  box-shadow: 0 8px 18px rgba(20, 115, 255, 0.14);
}

.agent-tool-panel > .workspace-page-card {
  max-height: none;
  overflow: visible;
}

.agent-secretary-chat-messages {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef6f6;
  scrollbar-gutter: stable;
}

.agent-secretary-chat-messages .message {
  max-width: min(760px, 94%);
}

.agent-secretary-chat-messages .message-actions {
  display: none;
}

.agent-secretary-chat-empty {
  display: grid;
  place-content: center;
  gap: 7px;
  min-height: 240px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.agent-secretary-chat-empty strong {
  color: var(--text);
  font-size: 18px;
}

.agent-secretary-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.agent-secretary-chat-composer textarea {
  max-height: 140px;
}

.agent-page-agent-card,
.agent-page-agent-follow-card,
.agent-secretary-history-card {
  align-self: start;
  max-height: calc(var(--app-height, 100dvh) - 210px);
  overflow: auto;
}

.line-page-agent-card,
.line-page-agent-follow-card,
.agent-page-agent-card,
.agent-page-agent-follow-card,
.agent-secretary-history-card,
.line-page-followup-card,
.line-page-quality-card {
  align-self: start;
  max-height: calc(var(--app-height, 100dvh) - 210px);
  overflow: auto;
}

.content-report-page > .content-report-toolbar {
  position: sticky;
  top: 82px;
  z-index: 3;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.96);
  backdrop-filter: blur(14px);
}

.content-report-page > .content-report-layout {
  padding: 16px 20px;
}

.content-report-page > .dashboard-table {
  padding: 0 20px 20px;
}

.hr-page-toolbar,
.crm-page-toolbar {
  position: sticky;
  top: 82px;
  z-index: 3;
  display: grid;
  grid-template-columns: 110px 170px minmax(190px, 1fr) 190px;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.96);
  backdrop-filter: blur(14px);
}

.hr-page-toolbar label,
.crm-page-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.crm-page-toolbar {
  grid-template-columns: minmax(240px, 1fr) 170px 180px 160px;
}

.crm-metrics {
  padding: 16px 20px 0;
}

.crm-broadcast-panel {
  padding: 14px 20px 0;
}

.broadcast-page-panel {
  padding: 16px 20px 24px;
}

.crm-broadcast-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.crm-broadcast-card-collapsed {
  padding: 12px 14px;
  background: #fff;
}

.crm-broadcast-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.crm-broadcast-head,
.crm-broadcast-actions,
.crm-broadcast-preview header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.crm-broadcast-head strong {
  display: block;
  font-size: 16px;
}

.crm-broadcast-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.crm-broadcast-tags,
.crm-broadcast-chipline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-broadcast-tags button,
.crm-broadcast-chipline span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-weight: 800;
}

.crm-broadcast-tags button.active {
  border-color: #0f766e;
  color: #0f766e;
  background: #ccfbf1;
}

.crm-broadcast-tags button span {
  color: var(--muted);
  font-size: 12px;
}

.crm-broadcast-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr) 190px;
  gap: 10px;
  align-items: end;
}

.crm-broadcast-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.crm-broadcast-message,
.crm-broadcast-attachments,
.crm-broadcast-actions {
  grid-column: 1 / -1;
}

.crm-broadcast-form textarea {
  min-height: 82px;
  resize: vertical;
}

.crm-broadcast-actions {
  justify-content: flex-end;
}

.crm-broadcast-attachments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
}

.crm-broadcast-attach-head,
.crm-broadcast-attach-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.crm-broadcast-attach-head strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.crm-broadcast-attach-head span,
.crm-broadcast-attachments small {
  color: var(--muted);
  font-size: 12px;
}

.crm-broadcast-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.crm-broadcast-file-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 36px 8px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.crm-broadcast-file-card img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
}

.crm-broadcast-file-card strong,
.crm-broadcast-file-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-broadcast-file-card strong {
  color: #0f172a;
  font-size: 13px;
}

.crm-broadcast-file-card span {
  color: var(--muted);
  font-size: 12px;
}

.crm-broadcast-file-card .tiny-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}

.crm-broadcast-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}

.crm-broadcast-preview.empty {
  color: var(--muted);
  font-size: 13px;
}

.crm-broadcast-preview.danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.crm-broadcast-preview p,
.crm-broadcast-chipline small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.crm-broadcast-recipient-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.crm-broadcast-recipient-list span,
.crm-broadcast-history article {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.crm-broadcast-recipient-list b,
.crm-broadcast-history span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-broadcast-recipient-list small,
.crm-broadcast-history small {
  color: var(--muted);
  font-size: 12px;
}

.crm-broadcast-history {
  display: grid;
  gap: 8px;
}

.crm-metric {
  text-align: left;
  cursor: pointer;
}

.crm-metric.active {
  border-color: rgba(20, 115, 255, 0.55);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(20, 115, 255, 0.12);
}

.crm-board-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.crm-board-title-actions > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.crm-board-title-actions label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.crm-board-title-actions select {
  min-height: 32px;
  padding: 0 30px 0 9px;
  font-size: 12px;
}

.crm-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  min-height: 0;
  padding: 16px 20px 20px;
}

.crm-board-card,
.crm-detail-card {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.crm-board-card {
  overflow: hidden;
}

.crm-detail-card {
  align-self: start;
  max-height: calc(var(--app-height, 100dvh) - 210px);
  overflow: auto;
}

.crm-funnel-board {
  display: grid;
  grid-auto-columns: minmax(230px, 270px);
  grid-auto-flow: column;
  gap: 10px;
  align-items: stretch;
  height: clamp(460px, calc(var(--app-height, 100dvh) - 320px), 720px);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.crm-funnel-board.list-view {
  display: block;
  height: auto;
  overflow: visible;
  padding-bottom: 0;
}

.crm-list-view {
  display: grid;
  gap: 8px;
}

.crm-list-head,
.crm-list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) 130px 100px 125px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.crm-list-head {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

.crm-list-row {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.crm-list-row:hover,
.crm-list-row.active {
  border-color: #1473ff;
  background: #f8fbff;
  box-shadow: 0 0 0 2px rgba(20, 115, 255, 0.1);
}

.crm-list-row > span,
.crm-list-customer {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.crm-list-row strong,
.crm-list-row b,
.crm-list-row small,
.crm-list-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-list-row small,
.crm-list-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.crm-list-due b {
  color: #991b1b;
}

.crm-list-pager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}

.crm-list-pager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.crm-funnel-board.compact .crm-list-row {
  min-height: 58px;
  padding: 8px 10px;
}

.crm-funnel-board.compact .crm-list-row small,
.crm-funnel-board.compact .crm-list-row em {
  display: none;
}

.crm-stage-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.crm-stage-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-stage-column header span {
  display: inline-grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
}

.crm-stage-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.crm-stage-empty {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.crm-customer-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.crm-funnel-board.compact {
  grid-auto-columns: minmax(210px, 235px);
}

.crm-funnel-board.compact .crm-stage-column {
  padding: 8px;
}

.crm-funnel-board.compact .crm-customer-card {
  gap: 4px;
  padding: 8px;
}

.crm-funnel-board.compact .crm-customer-card > span:not(.crm-card-top),
.crm-funnel-board.compact .crm-customer-card small,
.crm-funnel-board.compact .crm-customer-card em {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.crm-customer-card.active {
  border-color: #1473ff;
  box-shadow: 0 0 0 2px rgba(20, 115, 255, 0.12);
}

.crm-customer-card span,
.crm-customer-card small,
.crm-customer-card em {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.crm-customer-card > span:not(.crm-card-top),
.crm-customer-card small,
.crm-customer-card em {
  color: var(--muted);
  font-size: 12px;
}

.crm-card-top {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.crm-priority {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.crm-priority.hot,
.crm-priority.urgent,
.crm-priority.at_risk {
  background: #fee2e2;
  color: #991b1b;
}

.crm-priority.vip {
  background: #fef3c7;
  color: #92400e;
}

.crm-stage-pager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding-top: 2px;
}

.crm-stage-pager span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-stage-pager button {
  min-height: 30px;
  padding: 0 8px;
}

.crm-detail-form,
.crm-activity-form,
.crm-customer-detail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.crm-detail-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.crm-detail-head div {
  display: grid;
  gap: 2px;
}

.crm-detail-head span,
.crm-detail-section h3,
.crm-activity-form > strong {
  color: var(--muted);
}

.crm-close-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.crm-close-actions.closed {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.crm-close-actions > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.crm-close-actions > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-close-actions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .crm-close-actions {
    grid-template-columns: 1fr;
  }

  .crm-close-actions > div:last-child {
    justify-content: stretch;
  }

  .crm-close-actions > div:last-child button {
    flex: 1 1 140px;
  }
}

.crm-memory-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fafc;
}

.crm-memory-panel.empty {
  border-style: dashed;
  color: var(--muted);
}

.crm-memory-panel.risk-hot {
  border-color: #fed7aa;
  background: #fffbeb;
}

.crm-memory-panel.risk-urgent {
  border-color: #fecaca;
  background: #fff7ed;
}

.crm-memory-panel header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.crm-memory-panel header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crm-memory-panel header span,
.crm-memory-panel header small,
.crm-memory-panel p,
.crm-memory-panel li,
.crm-memory-panel div > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.crm-memory-panel p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.crm-memory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.crm-memory-grid > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.crm-memory-grid ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
}

.crm-memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-memory-tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 11px;
  font-weight: 800;
}

.crm-tag-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.crm-tag-editor-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.crm-tag-editor-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crm-tag-editor-head span,
.crm-tag-editor-head small,
.crm-tag-suggestions > span {
  color: var(--muted);
  font-size: 12px;
}

.crm-tag-editor-head strong {
  font-size: 13px;
}

.crm-tag-chip-list,
.crm-tag-suggestions div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.crm-editable-tag,
.crm-tag-suggestions button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.crm-editable-tag {
  border-color: #99f6e4;
  color: #0f766e;
  background: #ecfdf5;
}

.crm-editable-tag b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 14px;
  line-height: 1;
}

.crm-editable-tag:hover {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fff7f7;
}

.crm-editable-tag:hover b {
  color: #fff;
  background: #ef4444;
}

.crm-tag-empty {
  color: var(--muted);
  font-size: 12px;
}

.crm-tag-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.crm-tag-suggestions {
  display: grid;
  gap: 6px;
}

.crm-tag-suggestions button:hover {
  border-color: #1473ff;
  background: #eff6ff;
}

.crm-tag-suggestions small {
  color: var(--muted);
  font-size: 11px;
}

.crm-detail-section {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.crm-detail-section h3 {
  margin: 0;
  font-size: 13px;
}

.crm-activity-form {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.crm-activity-list,
.crm-message-list {
  display: grid;
  gap: 8px;
}

.crm-activity-list article,
.crm-message-list article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.crm-activity-list article span,
.crm-activity-list article small,
.crm-message-list article header span {
  color: var(--muted);
  font-size: 12px;
}

.crm-activity-list p,
.crm-message-list p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.crm-message-list article.customer {
  border-color: #bbf7d0;
  background: #f7fee7;
}

.crm-message-list article.assistant {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.crm-message-list article header {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.hr-page > .leave-overview {
  padding: 16px 20px 0;
}

.hr-v2-panel {
  display: grid;
  gap: 14px;
  padding: 16px 20px 0;
}

.hr-home-body {
  min-height: 100vh;
  overflow: auto;
  background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 48%, #e9fff8 100%);
}

.hr-home {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.hr-home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
}

.hr-home-header h1,
.hr-home-header p {
  margin: 0;
}

.hr-home-header p {
  margin-top: 4px;
  color: var(--muted);
}

.hr-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hr-home-tabs {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.hr-home-tabs button {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f4f8fc;
  color: #334155;
  font-weight: 700;
}

.hr-home-tabs button.active {
  border-color: rgba(20, 115, 255, 0.42);
  background: #e9f3ff;
  color: #075985;
}

.hr-tab-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.hr-section-stack {
  display: grid;
  gap: 14px;
}

.hr-section-hidden {
  display: none !important;
}

.hr-leave-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hr-leave-subtabs button {
  flex: 1 1 140px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  background: #f4f8fc;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hr-leave-subtabs button.active {
  border-color: rgba(20, 115, 255, 0.42);
  background: #e9f3ff;
  color: #075985;
}

/* .hr-section-stack sets display:grid, which would override the [hidden] attribute,
   so an inactive sub-panel needs this higher-specificity rule to actually hide. */
.hr-leave-subpanel[hidden] {
  display: none;
}

.hr-leave-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  justify-content: flex-end;
}

.hr-leave-actions .inline-month-filter {
  margin: 0;
}

.hr-leave-grid {
  padding: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.hr-home .hr-v2-panel {
  padding: 0;
}

.hr-v2-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  background: #f7fbff;
}

.hr-v2-hero h3,
.hr-v2-hero p {
  margin: 0;
}

.hr-v2-hero p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.hr-v2-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(280px, 0.8fr) minmax(260px, 0.7fr);
  gap: 14px;
}

.hr-v2-clock-form,
.hr-v2-location-form {
  display: grid;
  gap: 10px;
}

.hr-v2-clock-feedback {
  padding: 11px 12px;
  border: 1px solid #f2b8b5;
  border-radius: 9px;
  background: #fff2f1;
  color: #9f1c16;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-line;
}

.hr-v2-clock-feedback[hidden] {
  display: none;
}

.hr-v2-clock-feedback.is-warning {
  border-color: #f2d18a;
  background: #fff8e8;
  color: #7b4d00;
}

.hr-v2-clock-feedback.is-success {
  border-color: #9ed9b0;
  background: #effbf2;
  color: #176b35;
}

.hr-v2-location-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-v2-location-form input[name="id"],
.hr-v2-location-form input[name="name"],
.hr-v2-location-form button[type="submit"] {
  grid-column: 1 / -1;
}

.hr-v2-clock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hr-v2-my-record {
  margin-top: 12px;
}

.hr-v2-record-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.hr-v2-record-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.hr-v2-record-summary span,
.hr-v2-record-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-record-summary strong {
  display: block;
  margin-top: 4px;
}

.hr-v2-qr-box {
  display: grid;
  gap: 10px;
  min-height: 190px;
  align-content: center;
}

.hr-v2-qr-image {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hr-v2-qr-image svg {
  width: min(190px, 100%);
  height: auto;
}

.hr-v2-qr-meta {
  display: grid;
  gap: 3px;
  text-align: center;
}

.hr-v2-qr-meta strong {
  font-size: 18px;
  letter-spacing: 0;
}

.hr-v2-qr-meta span {
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-shift-form,
.hr-v2-payroll-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hr-v2-shift-form label,
.hr-v2-payroll-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.hr-v2-work-days {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hr-v2-work-days legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-shift-form .check-row,
.hr-v2-shift-form button[type="submit"],
.hr-v2-payroll-form button {
  align-self: end;
}

.hr-v2-overtime-card {
  display: grid;
  gap: 12px;
}

.hr-v2-overtime-policy,
.hr-v2-overtime-payroll-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.5;
}

.hr-v2-overtime-payroll-note {
  display: grid;
  margin-bottom: 10px;
}

.hr-v2-overtime-payroll-note span {
  color: #475569;
}

.hr-v2-overtime-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.hr-v2-overtime-filter label,
.hr-v2-review-dialog-form > label,
.hr-v2-review-fields label,
.hr-v2-payroll-edit-form > label,
.hr-v2-payroll-edit-group label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.hr-v2-overtime-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hr-v2-overtime-table {
  min-width: 1040px !important;
}

.hr-v2-overtime-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.hr-v2-overtime-status.is-pending {
  color: #92400e;
  background: #fef3c7;
}

.hr-v2-overtime-status.is-approved {
  color: #166534;
  background: #dcfce7;
}

.hr-v2-overtime-status.is-rejected {
  color: #b91c1c;
  background: #fee2e2;
}

.hr-v2-overtime-actions,
.hr-v2-payroll-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 145px;
}

.danger-text {
  color: #b91c1c !important;
}

.hr-v2-shifts {
  margin-top: 12px;
}

.hr-v2-shift-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.hr-v2-shift-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.hr-v2-shift-card.is-disabled {
  opacity: 0.58;
}

.hr-v2-shift-card strong,
.hr-v2-shift-card small,
.hr-v2-employee-table small {
  display: block;
}

.hr-v2-shift-card small,
.hr-v2-employee-table small {
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-employee-table input,
.hr-v2-employee-table select,
.hr-v2-employee-table textarea {
  width: 100%;
  min-width: 120px;
}

.hr-v2-pay-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.compact-check {
  margin-bottom: 4px;
  font-size: 12px;
}

.compact-section-title {
  margin-top: 14px;
}

dialog.modal.hr-v2-slip-dialog {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #f1f5f9;
}

.hr-v2-slip-dialog > .dialog-close-form {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 4;
}

.hr-v2-slip-dialog > .dialog-close-form .icon-button {
  border-color: #cbd5e1;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

#hr-v2-slip-content {
  max-height: calc(100dvh - 98px);
  padding: 24px;
  overflow: auto;
}

.hr-v2-slip-dialog > .dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px;
  border-top: 1px solid #dbe3ec;
  background: #fff;
}

.hr-v2-slip {
  display: grid;
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
  padding: 28px;
  color: #172033;
  border: 1px solid #d5dde7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.hr-v2-slip h3,
.hr-v2-slip p,
.hr-v2-slip dl,
.hr-v2-slip dd {
  margin: 0;
}

.hr-v2-slip-letterhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 16px;
  border-bottom: 3px solid #162033;
}

.hr-v2-slip-company {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.hr-v2-slip-company img {
  display: block;
  width: 168px;
  height: auto;
  flex: 0 0 auto;
}

.hr-v2-slip-brand-mark {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #0891b2, #2563eb);
  color: #fff;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hr-v2-slip-company-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.hr-v2-slip-company-copy strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
}

.hr-v2-slip-company-copy span {
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.hr-v2-slip-document-meta {
  display: grid;
  min-width: 245px;
  gap: 4px;
  padding-left: 22px;
  border-left: 1px solid #cbd5e1;
  text-align: right;
}

.hr-v2-slip-document-meta h3 {
  color: #111827;
  font-size: 25px;
  letter-spacing: -0.02em;
}

.hr-v2-slip-document-meta dl {
  display: grid;
  gap: 3px;
  margin-top: 6px;
}

.hr-v2-slip-document-meta dl div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11px;
}

.hr-v2-slip-document-meta dt {
  color: #64748b;
}

.hr-v2-slip-document-meta dd {
  color: #334155;
  font-weight: 700;
}

.hr-v2-slip-document-meta dd.is-draft {
  color: #9a6700;
}

.hr-v2-slip-document-meta dd.is-locked,
.hr-v2-slip-document-meta dd.is-paid {
  color: #047857;
}

.hr-v2-slip-period {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(190px, 1fr) minmax(120px, 0.7fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #cbd5e1;
}

.hr-v2-slip-period > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: #f8fafc;
}

.hr-v2-slip-period span,
.hr-v2-slip-employee span,
.hr-v2-slip-grid span {
  display: block;
  color: #64748b;
  font-size: 11px;
}

.hr-v2-slip-period strong {
  font-size: 13px;
}

.hr-v2-slip-employee {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-left: 4px solid #162033;
  background: #f8fafc;
}

.hr-v2-slip-employee > div {
  display: grid;
  align-content: start;
  gap: 3px;
}

.hr-v2-slip-employee .is-primary strong {
  font-size: 16px;
}

.hr-v2-slip-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #dbe3ec;
}

.hr-v2-slip-section-title span {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.hr-v2-slip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.hr-v2-slip-grid div {
  display: grid;
  min-height: 50px;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #dbe3ec;
  border-radius: 6px;
  background: #fff;
}

.hr-v2-slip-grid strong {
  color: #1e293b;
  font-size: 13px;
}

.hr-v2-slip-money {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hr-v2-slip-money > section {
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.hr-v2-slip-money h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1f8f67;
  font-size: 14px;
}

.hr-v2-slip-money .is-deduction h4 {
  border-bottom-color: #c2413b;
}

.hr-v2-slip-money h4 span {
  color: #172033;
  font-size: inherit;
  font-weight: 800;
}

.hr-v2-slip-money h4 small {
  color: #64748b;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.hr-v2-slip-money span {
  display: block;
  color: #475569;
  font-size: 12px;
}

.hr-v2-payroll-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 13px;
}

.hr-v2-payroll-line:first-of-type {
  border-top: 0;
}

.hr-v2-payroll-line strong {
  white-space: nowrap;
}

.hr-v2-payroll-line.total {
  margin-top: 6px;
  padding-top: 10px;
  border-top-color: var(--line);
  font-weight: 700;
}

.hr-v2-payroll-line.is-empty {
  opacity: 0.7;
}

.hr-v2-slip-money .net {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 24px;
  border-color: #9db9ad;
  background: linear-gradient(135deg, #eef8f4, #f8fbfa);
}

.hr-v2-slip-money .net strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #075c45;
  font-size: 28px;
}

.hr-v2-slip-money .net small {
  color: #37685b;
  font-size: 10px;
}

.hr-v2-slip-money .net div small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hr-v2-slip-footer {
  display: grid;
  gap: 20px;
  color: #475569;
}

.hr-v2-slip-note {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 11px;
}

.hr-v2-slip-note small {
  color: #7c2d12;
}

.hr-v2-slip-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.hr-v2-slip-signatures > div {
  display: grid;
  gap: 3px;
  text-align: center;
}

.hr-v2-slip-signatures > div > span {
  height: 34px;
  border-bottom: 1px solid #64748b;
}

.hr-v2-slip-signatures small {
  color: #94a3b8;
  font-size: 9px;
}

.hr-v2-slip-system-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid #dbe3ec;
  color: #64748b;
  font-size: 9px;
  letter-spacing: 0.04em;
}

@media (max-width: 980px) {
  .hr-v2-panel {
    padding: 12px;
  }

  .hr-v2-hero,
  .hr-v2-grid,
  .hr-v2-record-summary,
  .hr-v2-location-form,
  .today-attendance-grid {
    grid-template-columns: 1fr;
  }

  .hr-v2-hero {
    display: grid;
  }

  .hr-v2-clock-actions {
    grid-template-columns: 1fr;
  }

  .hr-home {
    width: min(100% - 16px, 1500px);
    padding: 8px 0 24px;
  }

  .hr-home-header,
  .hr-home-actions {
    display: grid;
    justify-content: stretch;
  }

  .hr-home-tabs {
    top: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-home-tabs button {
    min-height: 44px;
  }

  .hr-leave-actions {
    display: grid;
    justify-content: stretch;
  }

  .hr-leave-grid {
    grid-template-columns: 1fr;
  }

  .leave-report-metrics,
  .leave-report-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-v2-shift-form,
  .hr-v2-payroll-form,
  .hr-v2-pay-fields,
  .hr-v2-slip-period,
  .hr-v2-slip-employee,
  .hr-v2-slip-grid,
  .hr-v2-slip-money {
    grid-template-columns: 1fr;
  }

  .hr-v2-shift-card,
  .hr-v2-slip header {
    display: grid;
  }

  .hr-v2-slip-company {
    display: grid;
  }

  .hr-v2-slip-document-meta {
    min-width: 0;
    padding: 14px 0 0;
    border-top: 1px solid #cbd5e1;
    border-left: 0;
    text-align: left;
  }

  .hr-v2-slip-document-meta dl div {
    justify-content: flex-start;
  }

  .hr-v2-slip-money .net {
    grid-template-columns: 1fr;
  }

  .hr-v2-slip-money .net strong {
    grid-row: auto;
    grid-column: auto;
  }
}

.hr-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
  gap: 14px;
  padding: 16px 20px;
}

.hr-page-grid.hr-leave-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  padding: 0;
}

.hr-page-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hr-page > .hr-page-card {
  margin: 0 20px 20px;
}

.hr-dashboard-card {
  overflow: hidden;
}

.hr-approval-card {
  align-self: start;
  max-height: calc(var(--app-height, 100dvh) - 230px);
  overflow: auto;
}

.hr-tab-launcher {
  align-content: center;
  padding: 10px;
  text-align: center;
}

.admin-tab-launcher {
  align-content: center;
  padding: 10px;
  text-align: center;
}

.admin-page-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(0, 1.14fr);
  gap: 14px;
  padding: 16px 20px;
}

.admin-page-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.admin-create-form input[name="username"],
.admin-create-form input[name="address"],
.admin-create-form input[name="password"],
.admin-create-form button[type="submit"] {
  grid-column: 1 / -1;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-action-grid button {
  min-height: 44px;
}

.admin-page-card.integration-panel {
  margin: 0;
}

.admin-page-grid .line-followup-card {
  grid-column: 1 / -1;
}

.admin-page-grid .line-followup-card .line-followup-dashboard {
  max-height: min(560px, 58vh);
  overflow: auto;
  padding-right: 2px;
}

.admin-page-grid .line-followup-card .line-followup-list {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.admin-page-grid .line-followup-card .line-followup-case {
  align-content: start;
}

.admin-page-grid .line-followup-card .line-followup-case header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.admin-users-card {
  margin: 0 20px 20px;
}

.admin-users-card .admin-user-list {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: visible;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-modal {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.modal-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.modal-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body h2 {
  margin: 0;
}

.modal-body header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-body {
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.image-preview-modal {
  width: min(1080px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.image-preview-body {
  max-height: calc(100vh - 28px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.image-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-preview-toolbar button,
.image-preview-toolbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.image-preview-toolbar button {
  cursor: pointer;
}

.image-preview-toolbar span {
  min-width: 68px;
  background: #f8fafc;
}

.image-preview-stage {
  display: grid;
  place-items: center;
  min-height: min(58vh, 640px);
  overflow: auto;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #0f172a;
  overscroll-behavior: contain;
}

.image-preview-stage.is-zoomed {
  display: block;
  place-items: initial;
}

.image-preview-stage img {
  --image-preview-zoom: 1;
  display: block;
  max-width: 100%;
  max-height: min(68vh, 720px);
  object-fit: contain;
  cursor: zoom-in;
}

.image-preview-stage img.is-zoomed {
  width: calc(100% * var(--image-preview-zoom));
  max-width: none;
  max-height: none;
  margin: 0;
  cursor: zoom-out;
}

.image-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.image-preview-actions a {
  text-decoration: none;
  text-align: center;
}

.bio-modal {
  width: min(620px, calc(100vw - 24px));
}

.bio-body {
  gap: 14px;
}

.user-bio-content {
  display: grid;
  gap: 12px;
}

.bio-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #eef7ff, #f6fffb);
}

.bio-avatar-large {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  font-size: 24px;
}

.bio-hero-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.bio-hero-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
}

.bio-hero-copy span,
.bio-status-row small,
.bio-detail-grid span,
.bio-text span {
  color: var(--muted);
  font-size: 12px;
}

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

.bio-status-note {
  padding: 10px 12px;
  border-radius: 8px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.bio-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bio-detail-grid div,
.bio-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bio-detail-grid strong,
.bio-text p {
  margin: 0;
  overflow-wrap: anywhere;
}

.bio-text p {
  white-space: pre-wrap;
  line-height: 1.5;
}

.bio-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) 170px;
  gap: 10px;
}

.dashboard-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.dashboard-table table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: var(--panel);
}

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

.dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.dashboard-table td strong,
.dashboard-table td small {
  display: block;
}

.dashboard-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-table tr.is-muted > td {
  background: color-mix(in srgb, var(--panel-2) 78%, transparent);
  opacity: 0.72;
}

.hr-v2-late-cell {
  display: grid;
  gap: 6px;
  min-width: 170px;
  max-width: 220px;
}

.hr-v2-late-cell label {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-late-cell input {
  min-width: 0;
  height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
}

.hr-v2-late-cell .small-action {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.hr-v2-device-cell {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.hr-v2-device-cell small {
  display: block;
}

.hr-v2-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 110px;
}

.hr-v2-device-actions .small-action {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.dashboard-leave-cell {
  display: grid;
  gap: 2px;
  min-width: 76px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--panel-2);
}

.dashboard-leave-cell.near {
  background: #ffedd5;
}

.dashboard-leave-cell.over {
  background: #fee2e2;
}

.content-report-toolbar {
  grid-template-columns: 140px minmax(180px, 1fr) 120px;
}

.content-report-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.content-report-form,
.content-goal-form,
.content-report-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.content-report-form,
.content-goal-form {
  display: grid;
  gap: 10px;
}

.content-report-form label,
.content-goal-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.content-report-form textarea {
  min-height: 66px;
}

.content-report-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.content-report-summary {
  display: grid;
  gap: 10px;
}

.content-excel-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.content-excel-store {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #0f172a;
  border-radius: 8px;
  background: #fffdf3;
}

.content-excel-store header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #0f172a;
  background: #ffd966;
}

.content-excel-store.brand_secondary header {
  background: #93c47d;
}

.content-excel-store header strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
}

.content-excel-store header span {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.content-excel-scroll {
  overflow: auto;
}

.content-excel-store table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
}

.content-excel-store th,
.content-excel-store td {
  padding: 7px 8px;
  border-right: 1px solid #1f2937;
  border-bottom: 1px solid #d7cdb0;
  text-align: left;
  vertical-align: middle;
}

.content-excel-store th {
  background: #fff;
  font-size: 12px;
  text-align: center;
}

.content-excel-store td:nth-child(3),
.content-excel-store td:nth-child(4),
.content-excel-store td:nth-child(5) {
  text-align: center;
  font-weight: 800;
}

.content-excel-index {
  width: 34px;
  color: var(--muted);
  text-align: center !important;
}

.content-excel-progress {
  display: block;
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.content-excel-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #22c55e;
}

.content-excel-goal {
  position: relative;
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  isolation: isolate;
}

.content-excel-goal::before {
  position: absolute;
  inset: 4px 0 3px;
  z-index: -1;
  width: var(--goal-width);
  min-width: 4px;
  border-radius: 999px;
  background: #d9ead3;
  content: "";
}

.content-excel-remain.behind {
  color: #dc2626;
}

.content-excel-remain.near {
  color: #b45309;
}

.content-excel-remain.complete,
.content-excel-total .complete {
  color: #15803d;
}

.content-excel-total td {
  background: #f8fafc;
  font-weight: 900;
}

.content-excel-empty {
  padding: 18px !important;
  color: var(--muted);
  text-align: center !important;
}

.content-report-note {
  display: grid;
  gap: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.content-report-note strong {
  color: var(--text);
}

.content-report-tables {
  display: grid;
  gap: 14px;
}

.content-report-tables h3 {
  margin: 4px 0 8px;
  font-size: 15px;
}

.content-report-tables .dashboard-table-scroll {
  max-height: 360px;
}

.content-report-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 120px;
}

.content-report-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.content-report-links a:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: #dbeafe;
}

.member-picker {
  max-height: 190px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.check-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}

.check-row input {
  width: 17px;
  min-height: auto;
}

.search-modal {
  min-height: 360px;
}

.album-share-modal {
  width: min(520px, calc(100vw - 24px));
}

.drive-share-modal {
  width: min(580px, calc(100vw - 24px));
}

.drive-share-preview {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.drive-share-preview a {
  overflow-wrap: anywhere;
  color: var(--oc-primary);
  font-size: 12px;
}

.drive-share-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.album-share-room-list {
  display: grid;
  gap: 8px;
  max-height: min(420px, 58vh);
  overflow: auto;
}

.album-share-room {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.album-share-room input {
  width: 18px;
  min-height: 18px;
}

.album-share-room span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.album-share-room strong,
.album-share-room small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-share-room small {
  color: var(--muted);
}

.search-result {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.search-result button {
  padding: 0;
  border: 0;
  color: var(--accent-2);
  background: transparent;
  font-weight: 700;
}

.audit-modal {
  width: min(1360px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
}

.audit-body {
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  max-height: none;
  overflow: hidden;
}

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 120px;
  gap: 10px;
}

.audit-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  min-height: 0;
  height: 100%;
}

.audit-conversations,
.audit-message-panel {
  min-height: 0;
  height: 100%;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.audit-conversations {
  overflow: auto;
  padding: 8px;
}

.audit-room {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
}

.audit-room.active {
  border-color: rgba(15, 118, 110, 0.34);
  background: #eef8f6;
}

.audit-room strong,
.audit-current strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-room span,
.audit-room small,
.audit-room p,
.audit-current span {
  color: var(--muted);
  font-size: 12px;
}

.audit-room p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-message-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.audit-current {
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.audit-message-panel > .full-width {
  margin: 8px 10px;
  width: calc(100% - 20px);
}

.audit-messages {
  min-height: 0;
  height: 100%;
  width: 100%;
  padding: 14px;
}

.audit-messages .message-bubble {
  max-width: min(760px, 88%);
}

.audit-messages .empty-state {
  min-height: 260px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 7px;
  color: #fff;
  background: #17211f;
  box-shadow: var(--shadow);
  z-index: 20;
}

.big-notification {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 28px));
  z-index: 30;
  pointer-events: none;
}

.big-notification[hidden] {
  display: none;
}

.big-notification-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 33, 31, 0.24);
  pointer-events: auto;
  animation: big-notification-in 170ms ease-out;
}

.big-notification-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 22px;
  font-weight: 900;
}

.big-notification[data-type="task"] .big-notification-mark,
.big-notification[data-type="hr"] .big-notification-mark {
  font-size: 20px;
}

.big-notification-content {
  min-width: 0;
  padding-right: 30px;
}

.big-notification-room {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
}

.big-notification-content strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.big-notification-content p {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 12px;
  color: var(--muted);
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.big-notification-actions {
  display: flex;
  gap: 8px;
}

.big-notification-actions .primary,
.big-notification-actions .ghost {
  min-width: 102px;
  min-height: 36px;
}

.big-notification-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

html.desktop-client .big-notification {
  position: fixed;
  inset: var(--vv-offset-top, 0) 0 0 var(--vv-offset-left, 0);
  display: grid;
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  transform: none;
  place-items: center;
  padding: 22px;
  z-index: 80;
  pointer-events: none;
}

html.desktop-client .big-notification::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(37, 99, 235, 0.22), transparent 34%),
    rgba(8, 18, 28, 0.46);
  backdrop-filter: blur(2px);
  animation: big-notification-backdrop 170ms ease-out;
}

html.desktop-client .big-notification-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: min(860px, 100%);
  max-height: min(620px, calc(var(--app-height, 100dvh) - 44px));
  overflow: auto;
  padding: 26px;
  border: 2px solid rgba(37, 99, 235, 0.32);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(8, 18, 28, 0.38);
  pointer-events: auto;
  animation: big-notification-in 180ms ease-out;
}

html.desktop-client .big-notification-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(37, 99, 235, 0.12);
  border-radius: 7px;
  pointer-events: none;
}

html.desktop-client .big-notification-mark {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.34);
  font-size: 34px;
  font-weight: 900;
}

html.desktop-client .big-notification[data-type="task"] .big-notification-mark {
  background: #0f766e;
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.34);
  font-size: 25px;
}

html.desktop-client .big-notification[data-type="hr"] .big-notification-mark {
  background: #b91c1c;
  box-shadow: 0 14px 34px rgba(185, 28, 28, 0.34);
  font-size: 25px;
}

html.desktop-client .big-notification-content {
  min-width: 0;
  padding-right: 42px;
}

html.desktop-client .big-notification-room {
  color: #2563eb;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 5px;
}

html.desktop-client .big-notification[data-type="task"] .big-notification-room {
  color: #0f766e;
}

html.desktop-client .big-notification[data-type="hr"] .big-notification-room {
  color: #b91c1c;
}

html.desktop-client .big-notification-content strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 30px;
  line-height: 1.12;
}

html.desktop-client .big-notification-content p {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0 18px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.5;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

html.desktop-client .big-notification-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

html.desktop-client .big-notification-actions .primary,
html.desktop-client .big-notification-actions .ghost {
  min-width: 152px;
  min-height: 46px;
  font-size: 16px;
  font-weight: 800;
}

html.desktop-client .big-notification-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}

@keyframes big-notification-backdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.mobile-only {
  display: none;
}

.mobile-panel-close,
.mobile-panel-backdrop {
  display: none;
}

.ai-tools-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #dbe5ef;
  background: #f8fafc;
}

.ai-tools-copy {
  min-width: 150px;
  display: grid;
  gap: 2px;
}

.ai-tools-copy span,
.task-command-head span,
.task-command-urgent small {
  color: #64748b;
  font-size: 12px;
}

.ai-tool-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ai-tool-buttons button,
.task-command-metrics button,
.task-command-metrics > div,
.task-command-urgent button {
  border: 1px solid #d7e2ea;
  background: #ffffff;
  color: #0f172a;
}

.ai-tool-buttons button {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.task-command-center {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #f8fafc;
}

.task-command-head,
.storage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.task-command-head div,
.storage-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.task-command-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.task-command-metrics button,
.task-command-metrics > div {
  min-width: 0;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 2px;
  text-align: left;
}

.task-command-metrics button span,
.task-command-metrics > div span {
  color: #64748b;
  font-size: 11px;
}

.task-command-metrics button strong,
.task-command-metrics > div strong {
  font-size: 18px;
}

.task-command-metrics button.warning strong,
.task-command-metrics > div.warning strong,
.task-command-urgent button.overdue span {
  color: #dc2626;
}

.task-command-urgent {
  display: grid;
  gap: 6px;
}

.task-command-urgent button,
.task-command-empty {
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
}

.task-command-urgent button {
  display: grid;
  gap: 2px;
}

.task-command-empty {
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
}

.inline-month-filter {
  width: auto;
  max-width: 220px;
  font-size: 12px;
}

.hr-leave-calendar {
  display: grid;
  gap: 8px;
}

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

.calendar-weekdays span {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.calendar-cell {
  min-height: 94px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  overflow: hidden;
}

.calendar-cell.muted {
  background: transparent;
  border-color: transparent;
}

.calendar-cell.has-leave {
  border-color: #99d4ca;
  background: #f0fdfa;
}

.calendar-cell strong {
  display: block;
  margin-bottom: 6px;
}

.calendar-leave {
  display: block;
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #075985;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-leave.pending {
  background: #fef3c7;
  color: #92400e;
}

.storage-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.storage-section {
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.storage-row {
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 9px 10px;
  color: inherit;
  text-decoration: none;
}

.storage-row strong,
.storage-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-row span {
  color: #64748b;
  font-size: 12px;
}

.storage-row b {
  flex: 0 0 auto;
  color: #0f766e;
}

.storage-link:hover {
  border-color: #99d4ca;
  background: #f8fafc;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 64px 290px minmax(0, 1fr);
    padding: 12px;
  }

  .workspace-rail {
    justify-items: center;
  }

  .rail-button {
    grid-template-columns: 1fr;
    width: 44px;
    padding: 0;
    text-align: center;
  }

  .rail-label {
    display: none;
  }

  .rail-icon {
    background: transparent;
  }

  .sidebar {
    grid-template-areas:
      "top"
      "tabs"
      "source"
      "search"
      "content";
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    min-height: 0;
  }

  .sidebar-top {
    grid-area: top;
  }

  .mobile-sidebar-tabs {
    grid-area: tabs;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .mobile-sidebar-tab {
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: #f3f7fb;
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-sidebar-tab.active {
    color: var(--accent);
    border-color: rgba(15, 118, 110, 0.28);
    background: #dff3f0;
  }

  #mobile-people-count {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    margin-left: 4px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    font-size: 11px;
  }

  .search-field {
    grid-area: search;
    padding: 10px;
  }

  .conversation-list,
  .people-section {
    grid-area: content;
    min-height: 0;
  }

  .sidebar:not([data-mobile-mode]),
  .sidebar[data-mobile-mode="chats"],
  .sidebar[data-mobile-mode="people"] {
    overflow: hidden;
  }

  .sidebar:not([data-mobile-mode]) .people-section,
  .sidebar[data-mobile-mode="chats"] .people-section,
  .sidebar[data-mobile-mode="people"] .conversation-list {
    display: none;
  }

  .sidebar[data-mobile-mode="people"] .conversation-source-tabs {
    display: none;
  }

  .sidebar[data-mobile-mode="people"] .people-section {
    display: flex;
    flex-direction: column;
    border-top: 0;
    overflow: hidden;
  }

  .people-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .home-page,
  .line-page,
  .line-auto-reply-page,
  .agent-page,
  .broadcast-page,
  .content-report-page,
  .hr-page,
  .admin-page,
  .crm-page {
    grid-column: 3;
  }

  .workspace-rail {
    padding: 12px 8px;
  }

  .context-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 12;
    display: flex;
    flex-direction: column;
    width: min(360px, 94vw);
    height: 100vh;
    height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
    padding-top: 0;
  }

  .context-panel .tabs {
    flex: 0 0 auto;
    padding: max(10px, env(safe-area-inset-top)) 54px 10px 10px;
    background: var(--panel);
  }

  .context-panel .context-tab {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .context-panel.open {
    transform: translateX(0);
  }

  .context-close {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    z-index: 3;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    min-height: var(--app-height, 100vh);
    height: var(--app-height, 100vh);
    overflow: hidden;
  }

  body {
    position: fixed;
    inset: 0;
  }

  .auth-screen {
    place-items: start center;
    padding: 12px;
  }

  .auth-panel {
    padding: 18px;
  }

  .app-shell {
    position: fixed;
    top: var(--vv-offset-top, 0px);
    left: var(--vv-offset-left, 0px);
    width: var(--app-width, 100vw);
    height: var(--app-height, 100vh);
    max-height: var(--app-height, 100vh);
    grid-template-columns: 1fr;
    padding: 0;
  }

  .workspace-rail {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: var(--vv-offset-top, 0px);
    bottom: auto;
    left: var(--vv-offset-left, 0px);
    z-index: 12;
    width: min(360px, 94vw);
    height: var(--app-height, 100vh);
    max-height: var(--app-height, 100vh);
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  .context-panel {
    width: 100vw;
    height: var(--app-height, 100vh);
    max-height: var(--app-height, 100vh);
    border-radius: 0;
    border-left: 0;
    box-shadow: none;
  }

  .context-panel.hr-panel-active {
    width: 100vw;
  }

  .app-shell.home-mode,
  .app-shell.line-mode,
  .app-shell.agent-mode,
  .app-shell.content-report-mode,
  .app-shell.broadcast-mode,
  .app-shell.hr-mode,
  .app-shell.admin-mode,
  .app-shell.crm-mode {
    grid-template-columns: 1fr;
  }

  .app-shell.home-mode .sidebar,
  .app-shell.home-mode .chat-panel,
  .app-shell.home-mode .context-panel,
  .app-shell.line-mode .sidebar,
  .app-shell.line-mode .chat-panel,
  .app-shell.line-mode .context-panel,
  .app-shell.agent-mode .sidebar,
  .app-shell.agent-mode .chat-panel,
  .app-shell.agent-mode .context-panel,
  .app-shell.content-report-mode .sidebar,
  .app-shell.content-report-mode .chat-panel,
  .app-shell.content-report-mode .context-panel,
  .app-shell.broadcast-mode .sidebar,
  .app-shell.broadcast-mode .chat-panel,
  .app-shell.broadcast-mode .context-panel,
  .app-shell.hr-mode .sidebar,
  .app-shell.hr-mode .chat-panel,
  .app-shell.hr-mode .context-panel,
  .app-shell.admin-mode .sidebar,
  .app-shell.admin-mode .chat-panel,
  .app-shell.admin-mode .context-panel,
  .app-shell.crm-mode .sidebar,
  .app-shell.crm-mode .chat-panel,
  .app-shell.crm-mode .context-panel {
    display: none;
  }

  .home-page,
  .line-page,
  .line-auto-reply-page,
  .agent-page,
  .broadcast-page,
  .content-report-page,
  .hr-page,
  .admin-page,
  .crm-page {
    grid-column: 1;
    width: var(--app-width, 100vw);
    height: var(--app-height, 100vh);
    max-height: var(--app-height, 100vh);
    border: 0;
    border-radius: 0;
  }

  .workspace-page-header,
  .hr-page-header,
  .admin-page-header,
  .crm-page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  }

  .workspace-page-header h2,
  .hr-page-header h2,
  .admin-page-header h2,
  .crm-page-header h2 {
    font-size: 21px;
  }

  .workspace-page-actions,
  .hr-page-actions,
  .admin-page-actions,
  .crm-page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-page-actions button,
  .hr-page-actions button,
  .admin-page-actions button,
  .crm-page-actions button {
    min-height: 42px;
    padding: 0 8px;
  }

  .hr-page-toolbar,
  .crm-page-toolbar {
    top: 132px;
    grid-template-columns: 0.8fr 1.2fr;
    padding: 10px 12px;
  }

  .crm-metrics {
    padding: 12px 12px 0;
  }

  .crm-broadcast-panel {
    padding: 12px 12px 0;
  }

  .crm-broadcast-head,
  .crm-broadcast-actions,
  .crm-broadcast-attach-head,
  .crm-broadcast-preview header {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-broadcast-form {
    grid-template-columns: 1fr;
  }

  .crm-broadcast-actions button {
    width: 100%;
  }

  .crm-broadcast-attach-actions button {
    width: 100%;
  }

  .crm-broadcast-file-grid {
    grid-template-columns: 1fr;
  }

  .crm-broadcast-recipient-list {
    grid-template-columns: 1fr;
  }

  .crm-workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .crm-memory-panel header,
  .crm-memory-grid {
    grid-template-columns: 1fr;
  }

  .crm-memory-panel header {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-detail-card {
    max-height: none;
  }

  .crm-funnel-board {
    grid-auto-columns: minmax(220px, 82vw);
    height: min(620px, calc(var(--app-height, 100dvh) - 260px));
  }

  .crm-funnel-board.list-view {
    height: auto;
  }

  .crm-list-head {
    display: none;
  }

  .crm-list-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .crm-list-row > span:not(.crm-list-customer) {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .crm-board-title-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .crm-board-title-actions label {
    flex: 1 1 130px;
  }

  .crm-board-title-actions select {
    width: 100%;
  }

  .crm-stage-column {
    min-height: 0;
  }

  .today-metrics,
  .line-page-status,
  .content-report-page > .dashboard-metrics {
    padding: 12px 12px 0;
  }

  .today-priority-board,
  .line-page-grid,
  .agent-page-grid,
  .content-report-page > .content-report-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .agent-secretary-chat-card {
    grid-row: auto;
    height: clamp(360px, calc(var(--app-height, 100vh) - 170px), 680px);
    min-height: 0;
  }

  .agent-tool-panel {
    max-height: none;
    overflow: visible;
  }

  .agent-tool-tabs {
    display: flex;
    overflow-x: auto;
    position: static;
    padding: 6px;
  }

  .agent-tool-tabs button {
    flex: 0 0 auto;
    min-width: 112px;
  }

  .agent-secretary-chat-composer {
    grid-template-columns: 1fr;
  }

  .line-status-strip,
  .today-content-summary {
    grid-template-columns: 1fr;
  }

  .content-report-page > .content-report-toolbar {
    top: 132px;
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .content-report-page > .dashboard-table {
    padding: 0 12px 90px;
  }

  .crm-detail-head,
  .crm-message-list article header {
    display: grid;
  }

  .hr-page > .leave-overview {
    padding: 12px 12px 0;
  }

  .hr-page-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .hr-page-grid.hr-leave-grid {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .hr-page-card {
    padding: 12px;
  }

  .hr-page > .hr-page-card {
    margin: 0 12px calc(18px + env(safe-area-inset-bottom));
  }

  .admin-page-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .admin-page-card {
    padding: 12px;
  }

  .admin-create-form,
  .admin-action-grid {
    grid-template-columns: 1fr;
  }

  .admin-users-card {
    margin: 0 12px calc(18px + env(safe-area-inset-bottom));
  }

  .hr-approval-card {
    max-height: none;
    overflow: visible;
  }

  #hr-tab.context-tab.active {
    display: flex;
    flex-direction: column;
    padding: 10px 10px calc(120px + env(safe-area-inset-bottom));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-grid;
  }

  .mobile-hr-shortcut,
  .mobile-admin-shortcut {
    place-items: center;
  }

  .mobile-panel-close {
    display: inline-grid;
  }

  .mobile-panel-backdrop {
    position: fixed;
    top: var(--vv-offset-top, 0px);
    left: var(--vv-offset-left, 0px);
    z-index: 11;
    display: block;
    width: var(--app-width, 100vw);
    height: var(--app-height, 100vh);
    border: 0;
    background: rgba(17, 24, 39, 0.36);
  }

  .mobile-panel-backdrop[hidden] {
    display: none;
  }

  .sidebar-top {
    display: grid;
    align-items: start;
    justify-content: stretch;
    gap: 12px;
    min-height: auto;
    padding: max(14px, env(safe-area-inset-top)) 14px 12px;
    background: #fff;
  }

  .brand-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
  }

  .profile-avatar-button,
  .profile-avatar-button .avatar {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .profile-avatar-button {
    background: #f3f7fb;
  }

  .profile-camera {
    right: -3px;
    bottom: -3px;
    min-width: 26px;
    height: 20px;
    border-width: 2px;
    font-size: 10px;
  }

  .brand-copy {
    gap: 4px;
    align-content: center;
  }

  .brand-copy strong {
    max-width: 100%;
    font-size: 18px;
    line-height: 1.18;
  }

  #current-user-line {
    max-width: 100%;
    font-size: 13px;
  }

  .profile-name-button {
    margin-top: 2px;
    min-height: 30px;
    padding: 0 12px;
  }

  .sidebar-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fbfd;
  }

  .sidebar-actions .mobile-panel-close {
    display: grid;
  }

  .sidebar-actions .icon-button {
    width: 100%;
    min-width: 0;
    height: 40px;
    border-color: rgba(148, 163, 184, 0.22);
    background: #fff;
  }

  .chat-header {
    min-height: 58px;
    gap: 6px;
    padding: max(8px, env(safe-area-inset-top)) 8px 8px;
  }

  .chat-title-block h2 {
    font-size: 17px;
  }

  .chat-title-block p {
    font-size: 12px;
  }

  .chat-header-actions {
    gap: 4px;
  }

  .chat-header .icon-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .mobile-chat-nav {
    display: flex;
    gap: 6px;
    padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  }

  body.mobile-panel-open .chat-panel {
    pointer-events: none;
  }

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

  .agent-secretary-layout {
    grid-template-columns: 1fr;
  }

  .agent-secretary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-secretary-actions button {
    width: 100%;
  }

  .agent-follow-target-grid,
  .agent-follow-time-grid {
    grid-template-columns: 1fr;
  }

  .messages {
    padding: 10px 10px 6px;
    overscroll-behavior: contain;
  }

  .room-inspector {
    max-height: 42vh;
    padding: 12px;
  }

  .message {
    gap: 8px;
    margin-bottom: 8px;
  }

  .message-bubble {
    max-width: 86%;
  }

  .message.claim-notification-message .message-bubble {
    width: fit-content;
    max-width: 88%;
  }

  .claim-card-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .mention-suggestions {
    left: 10px;
    right: 10px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    max-height: min(42vh, 260px);
  }

  .message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 12px;
  }

  .room-task-strip {
    padding: 8px 10px;
  }

  .room-search-panel {
    padding: 8px 10px;
  }

  .room-search-bar {
    grid-template-columns: minmax(90px, 1fr) auto 34px 34px 34px;
    gap: 5px;
  }

  .room-search-result {
    flex-basis: min(300px, 84vw);
  }

  .room-task-chip {
    flex-basis: min(320px, 88vw);
  }

  .routine-reminder-form,
  .routine-time-grid,
  .routine-reminder-item {
    grid-template-columns: 1fr;
  }

  .routine-reminder-form button,
  .routine-reminder-item .task-actions {
    width: 100%;
  }

  .routine-reminder-item .task-actions {
    justify-content: stretch;
  }

  .routine-reminder-item .task-actions button {
    flex: 1 1 0;
  }

  .composer {
    grid-template-columns: 38px 38px 38px minmax(0, 1fr) 52px;
    gap: 5px;
    padding: 8px;
  }

  .composer .icon-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .composer textarea {
    min-height: 38px;
    max-height: 94px;
    padding: 9px 12px;
  }

  .sticker-panel {
    max-height: 178px;
    padding: 10px;
  }

  .send-button {
    width: 52px;
    min-height: 38px;
    border-radius: 14px;
  }

  .bio-hero,
  .bio-detail-grid,
  .bio-actions {
    grid-template-columns: 1fr;
  }

  .bio-avatar-large {
    width: 66px;
    height: 66px;
  }

  .file-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .album-card {
    padding: 8px;
  }

  .album-photo-grid {
    gap: 3px;
  }

  .album-downloads a {
    max-width: 140px;
  }

  .big-notification {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  .big-notification-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .big-notification-mark {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .big-notification-content {
    padding-right: 32px;
  }

  .big-notification-content strong {
    font-size: 18px;
  }

  .big-notification-content p {
    font-size: 14px;
    -webkit-line-clamp: 3;
  }

  .big-notification-actions {
    flex-wrap: wrap;
  }

  html.desktop-client .big-notification {
    inset: var(--vv-offset-top, 0) 0 0 var(--vv-offset-left, 0);
    display: grid;
    width: var(--app-width, 100vw);
    height: var(--app-height, 100dvh);
    padding: 12px;
    align-items: end;
  }

  html.desktop-client .big-notification-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    max-height: min(520px, calc(var(--app-height, 100dvh) - 24px));
    padding: 16px;
  }

  html.desktop-client .big-notification-mark {
    width: 58px;
    height: 58px;
    font-size: 25px;
  }

  html.desktop-client .big-notification-content strong {
    font-size: 21px;
  }

  html.desktop-client .big-notification-content p {
    font-size: 15px;
    -webkit-line-clamp: 5;
  }

  html.desktop-client .big-notification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .selected-file {
    min-width: 230px;
    grid-template-columns: 42px minmax(110px, 1fr) auto;
  }

  .selected-file img,
  .file-icon {
    width: 42px;
    height: 42px;
  }

  .selected-file-grid.album-mode .selected-file {
    min-width: 0;
    grid-template-columns: 1fr auto;
  }

  .selected-file-grid.album-mode .selected-file img {
    width: 100%;
    height: auto;
  }

  .admin-user,
  .member-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-user .role-pill,
  .admin-user .admin-position-select,
  .admin-user .admin-manager-select,
  .admin-user .admin-user-toggle,
  .member-item .role-pill,
  .member-item .member-remove {
    grid-column: 2;
    width: 100%;
  }

  .admin-user {
    align-items: start;
  }

  .hr-actions,
  .hr-filter-row,
  .dashboard-toolbar,
  .integration-actions,
  .line-quick-actions,
  .line-stats-hero,
  .line-dashboard-grid,
  .line-review-card header,
  .line-followup-case header,
  .line-ai-control-actions,
  .knowledge-file-controls {
    grid-template-columns: 1fr;
  }

  .content-report-layout {
    grid-template-columns: 1fr;
  }

  .content-excel-summary {
    grid-template-columns: 1fr;
  }

  .content-excel-store header {
    display: grid;
  }

  .content-excel-store header span {
    text-align: left;
  }

  .content-report-toolbar {
    grid-template-columns: 1fr;
  }

  .content-report-tables .dashboard-table-scroll {
    max-height: none;
  }

  .context-panel.hr-panel-active .hr-actions {
    position: sticky;
    top: 0;
    z-index: 2;
    grid-template-columns: 1fr 1fr;
    padding: 8px 0;
    background: var(--panel);
  }

  .context-panel.hr-panel-active .hr-filter-row {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .context-panel.hr-panel-active .hr-actions {
    order: 1;
  }

  .context-panel.hr-panel-active .hr-filter-row {
    order: 2;
  }

  .context-panel.hr-panel-active .leave-overview {
    order: 3;
    flex: 0 0 auto;
    overflow: visible;
  }

  .context-panel.hr-panel-active .leave-history-title {
    order: 4;
  }

  .context-panel.hr-panel-active .leave-list {
    order: 5;
    flex: 0 0 auto;
    overflow: visible;
  }

  .context-panel.hr-panel-active .leave-summary-title {
    order: 6;
  }

  .context-panel.hr-panel-active .leave-summary {
    order: 7;
    flex: 0 0 auto;
    overflow: visible;
  }

  .leave-item {
    scroll-margin-bottom: 120px;
  }

  .leave-note-input {
    min-height: 54px;
  }

  .leave-actions {
    position: sticky;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 2;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 2px -2px -2px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(18, 33, 31, 0.14);
    backdrop-filter: blur(10px);
  }

  .leave-actions button {
    min-height: 48px;
    font-weight: 800;
  }

  .leave-actions button:only-child {
    grid-column: 1 / -1;
  }

  .dashboard-modal {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .dashboard-body {
    height: 100dvh;
    max-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px calc(28px + env(safe-area-inset-bottom));
  }

  .dashboard-body header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 8px;
    background: var(--panel);
  }

  .audit-modal {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .audit-body {
    height: 100dvh;
    max-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom));
  }

  .audit-body header {
    position: sticky;
    top: 0;
    z-index: 3;
    padding-bottom: 8px;
    background: var(--panel);
  }

  .audit-toolbar {
    grid-template-columns: 1fr;
  }

  .audit-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 26vh) minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    height: 100%;
  }

  .audit-message-panel {
    min-height: 0;
    height: 100%;
  }

  .audit-messages {
    min-height: 0;
    height: 100%;
    padding: 10px;
  }

  .audit-current {
    min-height: 48px;
    padding: 8px 10px;
  }

  .audit-room {
    margin-bottom: 6px;
    padding: 8px;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-status-grid {
    grid-template-columns: 1fr;
  }

  .leave-head {
    display: grid;
  }

  .tabs {
    gap: 4px;
    padding: 8px;
  }

  .tab {
    min-height: 38px;
    padding: 0 6px;
    font-size: 13px;
  }

  .call-panel {
    align-items: end;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  }

  .call-card {
    width: 100%;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
  }

  .call-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .call-copy strong {
    font-size: 19px;
  }

  .call-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .drop-zone-hint {
    inset: 72px 10px 110px;
    min-height: 150px;
    padding: 18px;
    border-radius: 10px;
  }

  .drop-zone-hint strong {
    font-size: 16px;
  }

  .drop-zone-hint span {
    font-size: 12px;
  }

  .ai-tools-panel {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }

  .ai-tools-copy {
    min-width: 0;
  }

  .task-command-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-grid,
  .calendar-weekdays {
    gap: 4px;
  }

  .calendar-cell {
    min-height: 74px;
    padding: 6px;
  }

  .calendar-leave {
    font-size: 10px;
    padding: 3px 4px;
  }

  .storage-layout {
    grid-template-columns: 1fr;
  }

  .image-preview-modal {
    width: calc(100vw - 12px);
    max-height: calc(var(--app-height, 100vh) - 12px);
  }

  .image-preview-body {
    padding: 12px;
    max-height: calc(var(--app-height, 100vh) - 16px);
  }

  .image-preview-toolbar {
    justify-content: stretch;
    gap: 6px;
  }

  .image-preview-toolbar button,
  .image-preview-toolbar span {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
  }

  .image-preview-stage {
    min-height: 48vh;
  }

  .image-preview-actions {
    display: grid;
  }
}

/* Professional UI polish layer: keeps the product calmer and more consistent. */
:root {
  --ui-bg: #edf4ff;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8fbff;
  --ui-border: #d9e4f2;
  --ui-border-strong: #c4d4e7;
  --ui-text: #0f172a;
  --ui-muted: #64748b;
  --ui-primary: #1473ff;
  --ui-primary-hover: #0f5fd7;
  --ui-success: #0f766e;
  --ui-radius: 8px;
  --ui-control-height: 42px;
  --ui-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.055);
  --ui-shadow-card: 0 12px 32px rgba(15, 23, 42, 0.075);
}

body {
  color: var(--ui-text);
  background: var(--ui-bg);
}

.app-shell {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 60px rgba(38, 72, 116, 0.18);
}

.sidebar,
.chat-panel,
.context-panel,
.home-page,
.line-page,
.line-auto-reply-page,
.agent-page,
.broadcast-page,
.content-report-page,
.hr-page,
.admin-page,
.crm-page {
  border-color: var(--ui-border);
}

.workspace-page-header,
.hr-page-header,
.admin-page-header,
.crm-page-header,
.hr-home-header {
  gap: 18px;
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.workspace-page-header h2,
.hr-page-header h2,
.admin-page-header h2,
.crm-page-header h2 {
  color: var(--ui-text);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hr-home-header h1 {
  color: var(--ui-text);
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

.workspace-page-header p,
.hr-page-header p,
.admin-page-header p,
.crm-page-header p,
.hr-home-header p,
.workspace-page-kicker,
.hr-page-kicker,
.admin-page-kicker,
.crm-page-kicker {
  color: var(--ui-muted);
  line-height: 1.45;
}

.workspace-page-kicker,
.hr-page-kicker,
.admin-page-kicker,
.crm-page-kicker,
.compact-section-title,
.section-title,
.hr-section-title {
  letter-spacing: 0;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: none;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: var(--ui-control-height);
  padding-right: 12px;
  padding-left: 12px;
}

textarea {
  min-height: var(--ui-control-height);
  line-height: 1.5;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 255, 0.13);
}

.primary,
.ghost,
.secondary,
.danger-lite,
.tiny-button,
.small-action,
.icon-button,
.tab,
.context-tab,
.conversation-source-tab,
.mobile-sidebar-tab,
.hr-home-tabs button,
.mobile-chat-nav button,
.line-inbox-summary button,
.crm-broadcast-tags button,
.crm-broadcast-chipline span {
  border-radius: var(--ui-radius);
  letter-spacing: 0;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.primary,
.ghost,
.secondary,
.danger-lite {
  min-height: var(--ui-control-height);
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  box-shadow: 0 8px 18px rgba(20, 115, 255, 0.16);
}

.primary:hover:not(:disabled) {
  background: var(--ui-primary-hover);
  border-color: var(--ui-primary-hover);
}

.ghost,
.secondary {
  border-color: var(--ui-border);
  color: var(--ui-primary);
  background: var(--ui-surface);
}

.ghost:hover:not(:disabled),
.secondary:hover:not(:disabled) {
  border-color: rgba(20, 115, 255, 0.34);
  background: #f3f8ff;
}

.ghost.active,
.icon-button.active,
.notification-button.active,
.tab.active,
.context-tab.active,
.conversation-source-tab.active,
.mobile-sidebar-tab.active,
.hr-home-tabs button.active {
  border-color: rgba(20, 115, 255, 0.34);
  color: #0f5fd7;
  background: #eaf3ff;
}

.tiny-button,
.small-action {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.icon-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-color: var(--ui-border);
}

.workspace-page-card,
.hr-page-card,
.admin-page-card,
.crm-board-card,
.crm-detail-card,
.crm-broadcast-card,
.line-page-stats-card,
.line-page-agent-card,
.line-page-agent-follow-card,
.agent-page-agent-card,
.agent-page-agent-follow-card,
.line-page-followup-card,
.line-page-quality-card,
.line-inbox-list-panel,
.line-inbox-chat-panel,
.line-inbox-detail-panel,
.context-panel,
.auth-panel,
.hr-home-header,
.hr-home-tabs {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-soft);
}

.workspace-page-card,
.hr-page-card,
.admin-page-card,
.crm-board-card,
.crm-detail-card,
.crm-broadcast-card {
  padding: 16px;
}

.workspace-page-card + .workspace-page-card,
.hr-page-card + .hr-page-card,
.admin-page-card + .admin-page-card {
  margin-top: 12px;
}

.today-metrics,
.line-page-status,
.crm-metrics,
.content-report-page > .dashboard-metrics,
.dashboard-metrics,
.hr-metric-grid {
  gap: 10px;
}

.today-content-summary div,
.line-status-strip div,
.hr-metric,
.crm-metric,
.dashboard-metrics > *,
.line-inbox-summary button {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-soft);
}

.hr-metric {
  min-height: 78px;
  align-content: center;
  padding: 12px;
}

.hr-metric strong,
.today-content-summary strong,
.line-status-strip strong {
  color: var(--ui-text);
  font-weight: 900;
}

.hr-metric span,
.today-content-summary span,
.line-status-strip span,
.line-status-strip small {
  color: var(--ui-muted);
}

.chat-header {
  min-height: 72px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
}

.messages,
.line-inbox-messages {
  background: #eef5f8;
}

.message-bubble,
.line-inbox-bubble {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.message.ai-answer-message .message-bubble {
  max-width: min(760px, 82%);
  padding: 13px 16px;
  border-color: #dbeafe;
  background: #fff;
}

.message.ai-answer-message .message-text {
  color: var(--ui-text);
  font-size: 14px;
  line-height: 1.6;
}

.composer,
.line-inbox-composer {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.98);
}

.composer textarea {
  min-height: 44px;
  border-radius: 16px;
  background: #f8fbff;
}

.send-button {
  min-height: 44px;
  border-radius: 12px;
}

.line-inbox-workspace,
.crm-workspace,
.line-page-grid,
.today-priority-board,
.admin-page-grid {
  gap: 16px;
}

.line-inbox-detail-panel,
.crm-detail-card,
.hr-approval-card {
  scrollbar-gutter: stable;
}

.crm-board-title-actions,
.crm-page-actions,
.workspace-page-actions,
.hr-page-actions,
.admin-page-actions,
.hr-home-actions,
.line-inbox-chat-actions {
  gap: 8px;
}

.crm-list-head,
.crm-list-row,
.crm-customer-card,
.crm-broadcast-recipient-list span,
.crm-broadcast-history article,
.inspector-item {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
}

.crm-customer-card.active,
.crm-list-row.active {
  border-color: rgba(20, 115, 255, 0.55);
  background: #f3f8ff;
}

.dashboard-table-scroll {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
}

.dashboard-table th {
  background: #f1f6fd;
  color: #475569;
  letter-spacing: 0;
}

.dashboard-table td {
  background: #fff;
}

.hr-home {
  padding-top: 18px;
}

.hr-home-tabs {
  top: 10px;
  gap: 6px;
}

.hr-home-tabs button {
  min-height: 44px;
  font-size: 14px;
}

@media (max-width: 1020px) {
  .workspace-page-header h2,
  .hr-page-header h2,
  .admin-page-header h2,
  .crm-page-header h2 {
    font-size: 22px;
  }

  .hr-home-header h1 {
    font-size: 24px;
  }

  .workspace-page-card,
  .hr-page-card,
  .admin-page-card,
  .crm-board-card,
  .crm-detail-card,
  .crm-broadcast-card {
    padding: 14px;
  }
}

@media (max-width: 760px) {
  .leave-report-metrics,
  .leave-report-type-grid {
    grid-template-columns: 1fr;
  }

  .leave-report-profile,
  .leave-employee-report-card .hr-section-title {
    display: grid;
  }

  .app-shell {
    border: 0;
    box-shadow: none;
  }

  .workspace-page-header,
  .hr-page-header,
  .admin-page-header,
  .crm-page-header,
  .hr-home-header {
    padding: 14px 16px;
  }

  .workspace-page-header h2,
  .hr-page-header h2,
  .admin-page-header h2,
  .crm-page-header h2 {
    font-size: 20px;
  }

  .hr-home-header h1 {
    font-size: 22px;
  }

  .primary,
  .ghost,
  .secondary,
  .danger-lite {
    min-height: 44px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .message.ai-answer-message .message-bubble,
  .line-inbox-bubble {
    max-width: 88%;
  }

  .composer textarea,
  .line-inbox-composer textarea {
    font-size: 16px;
  }
}

/* Product navigation refresh: clearer workspaces for staff, sales, HR, and admins. */
:root {
  --product-bg: #eef5ff;
  --product-rail: #f8fbff;
  --product-rail-border: #d5e3f5;
  --product-card: #ffffff;
  --product-card-soft: #f7faff;
  --product-blue: #1473ff;
  --product-teal: #0f766e;
  --product-ink: #0f172a;
  --product-muted: #64748b;
  --product-line: #d9e5f3;
}

body {
  background:
    linear-gradient(135deg, rgba(20, 115, 255, 0.14), transparent 32%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.12), transparent 34%),
    var(--product-bg);
}

.app-shell {
  grid-template-columns: 112px 300px minmax(380px, 1fr) 330px;
  gap: 0;
  padding: 16px;
}

.workspace-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  justify-items: stretch;
  padding: 14px 10px;
  overflow: auto;
  overscroll-behavior: contain;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(248, 251, 255, 0.92);
}

.rail-avatar {
  width: 46px;
  height: 46px;
  margin: 0 auto 2px;
  border-radius: 15px;
  box-shadow: 0 12px 24px rgba(20, 115, 255, 0.18);
}

.rail-group {
  display: grid;
  gap: 6px;
  align-content: start;
}

.rail-group:not(:has(.rail-button:not([hidden]))) {
  display: none;
}

.rail-group-label {
  display: block;
  padding: 0 5px;
  color: #7a8aa0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
}

.rail-bottom {
  margin-top: auto;
  align-self: stretch;
}

.rail-button {
  width: 100%;
  min-height: 58px;
  height: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-content: center;
  justify-items: center;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #56657a;
  background: transparent;
}

.rail-button:hover,
.rail-button.active {
  border-color: rgba(20, 115, 255, 0.22);
  color: var(--product-blue);
  background: #eaf3ff;
  box-shadow: 0 8px 18px rgba(20, 115, 255, 0.08);
}

.rail-icon {
  width: 32px;
  min-width: 32px;
  height: 30px;
  border-radius: 10px;
  color: inherit;
  background: rgba(100, 116, 139, 0.08);
  font-size: 11px;
}

.rail-button.active .rail-icon,
.rail-button:hover .rail-icon {
  color: #fff;
  background: linear-gradient(135deg, var(--product-blue), var(--product-teal));
}

.rail-label {
  display: block;
  width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar {
  border-left: 1px solid rgba(255, 255, 255, 0.58);
}

.sidebar-top {
  padding: 16px 14px 12px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.brand-row {
  align-items: start;
}

.profile-avatar-button {
  flex: 0 0 auto;
}

.brand-copy {
  gap: 2px;
}

.profile-kicker {
  color: #526175;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

#current-user-name {
  color: var(--product-ink);
  font-size: 16px;
  line-height: 1.25;
}

#current-user-line {
  display: -webkit-box;
  overflow: hidden;
  color: var(--product-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-actions {
  padding: 12px 0 0;
  gap: 8px;
}

.sidebar-actions .icon-button,
.chat-header-actions .icon-button,
.composer .icon-button,
.line-inbox-composer .icon-button {
  border-radius: 12px;
}

.sidebar-install-link {
  min-height: 36px;
  margin-top: 10px;
  border-style: dashed;
  border-radius: 12px;
  font-size: 12px;
}

.conversation-source-tabs,
.mobile-sidebar-tabs {
  padding: 8px 10px;
  gap: 8px;
  background: #f8fbff;
}

.conversation-source-tab,
.mobile-sidebar-tab {
  min-height: 38px;
  border-radius: 12px;
  font-size: 12px;
}

.search-field {
  padding: 10px;
  background: #fff;
}

.search-field span {
  color: #718096;
  font-size: 11px;
  font-weight: 900;
}

.conversation-list,
.people-section {
  padding: 9px;
}

.conversation-item,
.person-item {
  min-height: 62px;
  padding: 9px;
  border-radius: 12px;
}

.conversation-item:hover,
.person-item:hover,
.conversation-item.active {
  background: #eff7ff;
}

.conversation-item.active {
  border-color: rgba(20, 115, 255, 0.34);
  box-shadow: inset 3px 0 0 var(--product-blue);
}

.conversation-name,
.person-name {
  overflow: hidden;
  color: var(--product-ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta,
.person-meta {
  max-height: 20px;
  color: var(--product-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 1;
}

.avatar {
  border-radius: 12px;
}

.badge {
  min-width: 24px;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.18);
}

.chat-header {
  border-bottom: 1px solid var(--product-line);
}

.chat-title-block h2 {
  color: var(--product-ink);
  font-size: 21px;
  font-weight: 900;
}

.chat-title-block p {
  color: var(--product-muted);
  font-size: 13px;
}

.messages,
.line-inbox-messages {
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 115, 255, 0.06), transparent 26%),
    #edf4f7;
}

.composer,
.line-inbox-composer {
  padding: 12px 14px;
}

.composer textarea,
.line-inbox-composer textarea {
  border-radius: 18px;
}

.workspace-page-header,
.hr-page-header,
.admin-page-header,
.crm-page-header {
  padding: 18px 22px;
}

.workspace-page-header h2,
.hr-page-header h2,
.admin-page-header h2,
.crm-page-header h2 {
  font-size: 25px;
  font-weight: 950;
}

.workspace-page-header p,
.hr-page-header p,
.admin-page-header p,
.crm-page-header p {
  max-width: 780px;
  font-size: 14px;
}

.workspace-page-actions,
.hr-page-actions,
.admin-page-actions,
.crm-page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-metrics > *,
.today-content-summary div,
.line-status-strip div,
.hr-metric,
.crm-metric {
  border-color: #dbe7f5;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.workspace-page-card,
.hr-page-card,
.admin-page-card,
.crm-board-card,
.crm-detail-card,
.crm-broadcast-card,
.line-inbox-list-panel,
.line-inbox-chat-panel,
.line-inbox-detail-panel {
  border-color: #dbe7f5;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
}

.line-inbox-contact,
.crm-list-row,
.crm-customer-card,
.agent-action-card,
.line-quality-card,
.line-followup-card,
.hr-approval-card {
  border-radius: 12px;
}

.crm-page-toolbar,
.dashboard-toolbar,
.content-report-toolbar {
  gap: 10px;
  padding: 12px 20px;
  background: rgba(248, 251, 255, 0.92);
}

.context-panel .tabs {
  gap: 8px;
  padding: 12px;
  background: #f8fbff;
}

.context-panel .tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.today-attendance-grid {
  grid-template-columns: minmax(360px, 0.92fr) minmax(430px, 1.08fr);
}

.today-attendance-summary {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.today-attendance-summary strong {
  overflow-wrap: anywhere;
}

.today-attendance-panel .hr-metric,
.today-attendance-panel .today-attendance-summary > * {
  min-width: 0;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 78px 300px minmax(340px, 1fr) 320px;
  }

  .app-shell.crm-mode {
    grid-template-columns: 78px 300px minmax(0, 1fr);
  }

  .app-shell.crm-mode .crm-page {
    grid-column: 3 / 4;
  }

  .workspace-rail {
    align-items: center;
    padding: 12px 8px;
  }

  .rail-group {
    justify-items: center;
  }

  .rail-group-label,
  .rail-label {
    display: none;
  }

  .rail-button {
    width: 44px;
    min-height: 44px;
    padding: 0;
  }
}

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

  .workspace-rail {
    display: none;
  }

  .mobile-chat-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--product-line);
    background: rgba(255, 255, 255, 0.98);
    scrollbar-width: none;
  }

  .mobile-chat-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-chat-nav button {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 12px;
  }

  .today-attendance-grid,
  .today-attendance-summary {
    grid-template-columns: 1fr;
  }

  .chat-header {
    min-height: 64px;
    padding: 10px 12px;
  }

  .chat-title-block h2 {
    font-size: 18px;
  }

  .workspace-page-header,
  .hr-page-header,
  .admin-page-header,
  .crm-page-header {
    align-items: start;
    padding: 14px 14px 12px;
  }

  .workspace-page-header h2,
  .hr-page-header h2,
  .admin-page-header h2,
  .crm-page-header h2 {
    font-size: 21px;
  }

  .workspace-page-actions,
  .hr-page-actions,
  .admin-page-actions,
  .crm-page-actions {
    width: 100%;
    justify-content: stretch;
  }

  .workspace-page-actions > *,
  .hr-page-actions > *,
  .admin-page-actions > *,
  .crm-page-actions > * {
    flex: 1 1 auto;
  }

  .conversation-meta,
  .person-meta {
    -webkit-line-clamp: 1;
  }
}

/* Commercial polish layer: keeps the existing app logic intact while making the UI presentation-ready. */
:root {
  --oc-bg: #eef5ff;
  --oc-surface: #ffffff;
  --oc-surface-soft: #f7fbff;
  --oc-surface-tint: #edf7f5;
  --oc-border: #d8e5f2;
  --oc-border-strong: #b8cce2;
  --oc-text: #102033;
  --oc-muted: #627089;
  --oc-primary: #1774ff;
  --oc-primary-strong: #0f5ed6;
  --oc-teal: #0f766e;
  --oc-danger: #dc2626;
  --oc-warning: #d97706;
  --oc-shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --oc-shadow-md: 0 14px 34px rgba(15, 23, 42, 0.1);
  --oc-radius: 12px;
}

body {
  color: var(--oc-text);
  background:
    radial-gradient(circle at 6% 8%, rgba(23, 116, 255, 0.16), transparent 28%),
    linear-gradient(135deg, #f6fbff 0%, #edf5ff 52%, #f4fffb 100%);
}

input,
select,
textarea,
button {
  letter-spacing: 0;
}

input,
select,
textarea {
  border-color: var(--oc-border);
  border-radius: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(23, 116, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(23, 116, 255, 0.12);
}

.app-shell {
  width: min(1920px, 100vw);
  margin: 0 auto;
  border: 1px solid rgba(216, 229, 242, 0.86);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 26px 70px rgba(21, 46, 86, 0.16);
}

.workspace-rail,
.sidebar,
.chat-panel,
.context-panel {
  border-color: var(--oc-border);
}

.workspace-rail {
  background: linear-gradient(180deg, #eaf3ff 0%, #f6fbff 100%);
}

.rail-button,
.icon-button,
.sidebar-actions .icon-button,
.chat-header .icon-button,
.line-inbox-chat-actions button,
.workspace-page-actions button,
.hr-page-actions button,
.admin-page-actions button,
.crm-page-actions button {
  min-height: 42px;
  border-color: var(--oc-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.055);
}

.rail-button.active,
.mobile-chat-nav button.active,
.conversation-source-tab.active,
.mobile-sidebar-tab.active,
.context-panel .tab.active {
  color: var(--oc-primary);
  border-color: rgba(23, 116, 255, 0.34);
  background: #e8f2ff;
}

.sidebar {
  background: rgba(255, 255, 255, 0.94);
}

.sidebar-top {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  border-bottom-color: var(--oc-border);
}

.brand-copy strong,
.chat-title-block h2,
.workspace-page-header h2,
.hr-page-header h2,
.admin-page-header h2,
.crm-page-header h2,
.line-page-header h2 {
  color: #071827;
  letter-spacing: 0;
}

.conversation-list,
.people-list,
.line-inbox-list {
  padding: 10px 8px;
  gap: 8px;
}

.conversation-item,
.person-item,
.line-inbox-contact {
  min-height: 68px;
  max-height: 96px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.conversation-item:hover,
.person-item:hover,
.line-inbox-contact:hover {
  transform: translateY(-1px);
  border-color: var(--oc-border);
  background: #f8fbff;
  box-shadow: var(--oc-shadow-sm);
}

.conversation-item.active,
.person-item.active,
.line-inbox-contact.active {
  border-color: rgba(15, 118, 110, 0.34);
  background: linear-gradient(180deg, #e8f7f4, #f5fbff);
  box-shadow: inset 3px 0 0 var(--oc-teal), var(--oc-shadow-sm);
}

.conversation-name,
.person-name,
.line-inbox-contact-copy strong {
  max-width: 100%;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.conversation-copy,
.conversation-meta,
.person-meta,
.line-inbox-contact-copy small,
.line-inbox-contact-copy em,
.line-inbox-contact-side time {
  display: -webkit-box;
  overflow: hidden;
  color: var(--oc-muted);
  line-height: 1.3;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.conversation-copy {
  -webkit-line-clamp: 2;
}

.chat-header,
.line-inbox-chat-header {
  min-height: 76px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--oc-border);
  box-shadow: 0 1px 0 rgba(216, 229, 242, 0.75);
}

.messages,
.line-inbox-messages {
  background:
    radial-gradient(circle at 18% 0%, rgba(23, 116, 255, 0.055), transparent 22%),
    linear-gradient(180deg, #edf5f7 0%, #eef6f9 100%);
}

.message-bubble,
.line-inbox-bubble {
  border: 1px solid rgba(216, 229, 242, 0.88);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.message.own .message-bubble,
.line-inbox-message.staff .line-inbox-bubble {
  border-color: rgba(23, 116, 255, 0.28);
  background: linear-gradient(180deg, #1c82ff, #126df0);
  box-shadow: 0 12px 26px rgba(23, 116, 255, 0.19);
}

.message.ai-answer-message .message-bubble,
.line-inbox-message.system .line-inbox-bubble {
  border-color: #cfe0f3;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.composer,
.line-inbox-composer {
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top-color: var(--oc-border);
}

.composer textarea,
.line-inbox-composer textarea {
  min-height: 46px;
  border-radius: 16px;
  background: #f8fbff;
}

.composer button[type="submit"],
.line-inbox-composer button[type="submit"],
.primary-button,
button.primary,
.btn-primary {
  border-color: var(--oc-primary);
  color: #fff;
  background: linear-gradient(180deg, #2388ff, var(--oc-primary));
  box-shadow: 0 12px 26px rgba(23, 116, 255, 0.22);
}

.workspace-page,
.hr-page,
.admin-page,
.crm-page,
.line-page,
.line-auto-reply-page,
.agent-page,
.broadcast-page {
  background: rgba(248, 251, 255, 0.72);
}

.workspace-page-header,
.hr-page-header,
.admin-page-header,
.crm-page-header,
.line-page-header,
.line-auto-reply-page-header,
.broadcast-page-header {
  margin-bottom: 14px;
  border: 1px solid var(--oc-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--oc-shadow-sm);
}

.workspace-page-header p,
.hr-page-header p,
.admin-page-header p,
.crm-page-header p,
.line-page-header p,
.line-auto-reply-page-header p,
.broadcast-page-header p {
  color: var(--oc-muted);
}

.dashboard-metrics,
.line-status-strip,
.today-content-summary,
.crm-metrics-grid,
.hr-metrics-grid {
  gap: 10px;
}

.dashboard-metrics > *,
.today-content-summary div,
.line-status-strip div,
.hr-metric,
.crm-metric,
.workspace-page-card,
.hr-page-card,
.admin-page-card,
.crm-board-card,
.crm-detail-card,
.crm-broadcast-card,
.line-inbox-list-panel,
.line-inbox-chat-panel,
.line-inbox-detail-panel,
.content-card,
.agent-action-card,
.line-quality-card,
.line-followup-card {
  border-color: var(--oc-border);
  border-radius: var(--oc-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--oc-shadow-sm);
}

.dashboard-metrics > *,
.today-content-summary div,
.line-status-strip div,
.hr-metric,
.crm-metric {
  min-height: 84px;
  padding: 14px 16px;
}

.dashboard-metrics strong,
.today-content-summary strong,
.line-status-strip strong,
.hr-metric strong,
.crm-metric strong {
  color: #071827;
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 900;
}

.crm-board-layout,
.line-inbox-workspace {
  gap: 12px;
}

.crm-list-row,
.crm-customer-card,
.crm-tag-editor,
.line-inbox-tag-form,
.hr-approval-card,
.notification-row {
  border-color: var(--oc-border);
  border-radius: 14px;
}

.crm-list-row:hover,
.crm-customer-card:hover,
.hr-approval-card:hover,
.notification-row:hover {
  box-shadow: var(--oc-shadow-sm);
}

.crm-tag-chip,
.crm-system-tag-chip,
.crm-editable-tag,
.tag-chip {
  min-height: 28px;
  border-radius: 999px;
  font-weight: 700;
}

.crm-broadcast-card,
.broadcast-compose-card {
  overflow: visible;
}

.line-inbox-message-text,
.line-inbox-system-text,
.message-text,
.message-bubble,
.notification-row,
.crm-customer-memory,
.crm-customer-memory p,
.line-quality-card p,
.line-followup-card p {
  overflow-wrap: anywhere;
}

.notification-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: min(82vh, 760px);
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.notification-body {
  max-height: min(82vh, 760px);
  overflow: hidden;
}

.notification-center-list {
  max-height: calc(min(82vh, 760px) - 116px);
  overflow: auto;
  padding-right: 6px;
}

.notification-row {
  max-width: 100%;
  overflow: hidden;
}

.notification-row strong,
.notification-row span,
.notification-row small {
  max-width: 100%;
}

.notification-row span {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Notification center must read like message cards, not compressed pill rows. */
.notification-center-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

button.notification-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: stretch;
  gap: 6px;
  height: auto !important;
  min-height: 86px;
  max-height: none !important;
  padding: 12px 14px !important;
  overflow: visible !important;
  white-space: normal !important;
  line-height: 1.4;
}

button.notification-row strong {
  display: -webkit-box;
  overflow: hidden;
  color: #071827;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

button.notification-row span {
  display: -webkit-box !important;
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

button.notification-row small {
  display: block;
  color: var(--oc-muted);
  font-size: 12px;
  line-height: 1.2;
}

.settings-grid,
.admin-grid,
.hr-grid,
.crm-form-grid {
  align-items: start;
  gap: 12px;
}

.customer-followup-column,
.line-followup-dashboard,
.agent-follow-rule-list,
.agent-follow-form {
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 1280px) {
  .app-shell {
    border-radius: 0;
  }

  /* Tablet: stack the LINE header so the 7-button toolbar wraps onto its own
     full-width row instead of overflowing off-screen (the actions are
     flex: 0 0 auto, so side-by-side they can't shrink/wrap). */
  .line-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .conversation-item,
  .person-item,
  .line-inbox-contact {
    min-height: 64px;
    max-height: 84px;
  }

  .conversation-copy,
  .conversation-meta,
  .person-meta,
  .line-inbox-contact-copy small,
  .line-inbox-contact-copy em {
    -webkit-line-clamp: 1;
  }

  .workspace-page-header,
  .hr-page-header,
  .admin-page-header,
  .crm-page-header,
  .line-page-header,
  .line-auto-reply-page-header,
  .broadcast-page-header {
    margin: 8px;
    border-radius: 16px;
  }

  .dashboard-metrics,
  .line-status-strip,
  .today-content-summary,
  .crm-metrics-grid,
  .hr-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    background: #f6fbff;
  }

  .app-shell {
    border: 0;
    box-shadow: none;
  }

  .chat-header,
  .line-inbox-chat-header {
    min-height: 64px;
  }

  .messages,
  .line-inbox-messages {
    background: linear-gradient(180deg, #eff6f8, #f6fbff);
  }

  .message-bubble,
  .line-inbox-bubble {
    max-width: min(84vw, 420px);
    border-radius: 16px;
  }

  .composer,
  .line-inbox-composer {
    padding: 10px max(10px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .dashboard-metrics,
  .line-status-strip,
  .today-content-summary,
  .crm-metrics-grid,
  .hr-metrics-grid {
    grid-template-columns: 1fr;
  }

  .notification-modal {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 40px);
    max-height: calc(var(--app-height, 100vh) - 40px);
  }

  .notification-center-list {
    max-height: calc(var(--app-height, 100vh) - 164px);
  }
}

/* LINE inbox official sticker and composer stability */
.line-inbox-sticker-panel {
  display: block;
  max-height: 360px;
  padding: 12px;
  border-top: 1px solid var(--oc-border, #dbe7f5);
  background: linear-gradient(180deg, #f8fbff, #edf7ff);
  overflow: auto;
}

/* Compact LINE customer inspector */
.line-inbox-workspace {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(250px, 300px);
}

.line-inbox-profile,
.line-inbox-ai-status,
.line-inbox-tag-form,
.crm-memory-panel,
.line-inbox-side-section {
  border-radius: 12px;
}

.crm-memory-panel {
  gap: 7px;
  padding: 9px 10px;
}

.crm-memory-panel header {
  gap: 6px;
}

.crm-memory-panel header span,
.crm-memory-panel header small,
.crm-memory-panel p,
.crm-memory-panel li,
.crm-memory-panel div > span {
  font-size: 11px;
  line-height: 1.35;
}

.crm-memory-panel header strong {
  font-size: 13px;
  line-height: 1.25;
}

.crm-memory-panel p {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.crm-memory-grid {
  gap: 6px;
}

.crm-memory-grid > div {
  gap: 4px;
  padding: 7px;
}

.crm-memory-grid ul {
  gap: 2px;
  padding-left: 16px;
}

.crm-memory-tags {
  gap: 4px;
  max-height: 52px;
  overflow: auto;
}

.crm-memory-tags span {
  padding: 2px 6px;
  font-size: 10.5px;
}

/* LINE composer overlap guard: keep tools above a full-width reply row. */
.line-inbox-composer,
.line-page.line-focus-mode .line-inbox-composer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 86px !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 58px !important;
  padding: 8px 10px !important;
  overflow: visible !important;
}

/* The toolbar (quick reply / sticker / attach / AI ช่วยคิด) sits on its own full
   width row above the textarea + send row, so the AI button can show its label
   without cramping the input in the ~466px LINE chat panel. */
.line-inbox-tools {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  min-width: 0;
}

/* Keep the actual reply controls on a separate row.  Without these explicit
   placements the legacy three-column rules in line-workspace.css can create an
   implicit third column, leaving the textarea only a few pixels wide on Mac. */
.line-inbox-composer > textarea {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

.line-inbox-composer > button[type="submit"] {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

.line-inbox-composer > .line-inbox-draft-status {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
}

/* Manual LINE quick replies are intentionally separate from Auto Reply rules. */
.line-inbox-quick-reply-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-width: 0;
  max-height: min(460px, 62vh);
  border-top: 1px solid var(--oc-border, #dbe7f5);
  background: #fff;
  overflow: hidden;
}

.line-inbox-quick-reply-panel[hidden] {
  display: none !important;
}

.line-quick-reply-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
}

.line-quick-reply-panel-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-quick-reply-panel-header strong {
  color: #102234;
  font-size: 14px;
}

.line-quick-reply-panel-header span {
  color: var(--oc-muted, #64748b);
  font-size: 11px;
  line-height: 1.35;
}

.line-quick-reply-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 14px 10px;
}

.line-quick-reply-toolbar > * {
  min-width: 0;
}

.line-quick-reply-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--oc-border, #dbe7f5);
  border-radius: 8px;
  background: #f8fbff;
}

.line-quick-reply-search .ui-icon {
  width: 16px;
  height: 16px;
  color: #64748b;
}

.line-quick-reply-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.line-quick-reply-toolbar select,
.line-quick-reply-toolbar button {
  min-height: 38px;
  border-radius: 8px;
}

.line-quick-reply-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.line-quick-reply-toolbar .ui-icon {
  width: 16px;
  height: 16px;
}

.line-quick-reply-favorites.active .ui-icon,
.line-quick-reply-fav-toggle.is-favorite .ui-icon,
.line-quick-reply-actions .is-favorite .ui-icon {
  fill: currentColor;
  color: #d97706;
}

.line-quick-reply-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.line-quick-reply-manage-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.line-quick-reply-manage-open .ui-icon {
  width: 15px;
  height: 15px;
}

/* Category tabs (picker) */
.line-quick-reply-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 14px 10px;
  scrollbar-width: thin;
}

.line-quick-reply-tab {
  flex: 0 0 auto;
  padding: 5px 12px;
  border: 1px solid var(--oc-border, #dbe7f5);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.line-quick-reply-tab.active {
  border-color: #1473ff;
  background: #1473ff;
  color: #fff;
}

.line-quick-reply-usecount {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 10px;
}

.line-quick-reply-list .line-quick-reply-item--pick {
  min-height: 52px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.line-quick-reply-item--pick .line-quick-reply-body {
  -webkit-line-clamp: 1;
}

.line-quick-reply-item--pick .line-quick-reply-fav-toggle {
  flex: 0 0 auto;
}

/* Manage dialog */
/* Override the generic .modal 560px cap so the manage dialog is genuinely wide.
   Widen the DIALOG element itself — widening only the inner body overflows the
   narrow frame (horizontal scrollbar + clipped content). */
.modal.line-quick-reply-manage-dialog {
  width: min(1080px, 96vw);
}

.line-quick-reply-manage-dialog .line-quick-reply-manage-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 92vh;
}

.line-quick-reply-manage-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto) auto;
  align-items: center;
  gap: 8px;
}

.line-quick-reply-manage-toolbar select,
.line-quick-reply-manage-toolbar button {
  min-height: 38px;
  border-radius: 8px;
}

.line-quick-reply-manage-toolbar .line-quick-reply-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Two-column card grid so far more replies are visible at once (fewer scrolls).
   auto-fill drops to one column on a narrow screen and grows to two on a wide one. */
.line-quick-reply-manage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 8px;
  align-content: start;
  min-height: 160px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e6eef7;
  border-radius: 10px;
}

.line-quick-reply-manage-list .line-quick-reply-item--manage {
  border: 1px solid #e6eef7;
  border-radius: 10px;
  min-height: 60px;
  padding: 8px 10px;
  background: #fff;
}

.line-quick-reply-manage-list .line-quick-reply-item--manage:hover {
  background: #f8fbff;
}

.line-quick-reply-manage-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.line-quick-reply-form-hint {
  margin: -2px 0 0;
  color: #64748b;
  font-size: 12px;
}

.line-quick-reply-form-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
}

.line-quick-reply-list {
  min-height: 90px;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid #e6eef7;
}

.line-quick-reply-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 9px 12px 9px 14px;
  border-bottom: 1px solid #e6eef7;
  background: #fff;
}

.line-quick-reply-item:hover {
  background: #f8fbff;
}

.line-quick-reply-item.is-inactive {
  background: #f8fafc;
  opacity: 0.74;
}

.line-quick-reply-use {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.line-quick-reply-use-text {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.line-quick-reply-thumb {
  flex: 0 0 auto;
}

.line-quick-reply-thumb img {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef4fb;
}

.line-quick-reply-use:not(:disabled) {
  cursor: pointer;
}

.line-quick-reply-image-field {
  display: grid;
  gap: 8px;
}

.line-quick-reply-image-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.line-quick-reply-image-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.line-quick-reply-image-preview img {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #d6e2f1;
  background: #eef4fb;
}

.line-quick-reply-image-hint {
  font-size: 11px;
  color: #64748b;
}

.line-quick-reply-item-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.line-quick-reply-item-head strong {
  overflow: hidden;
  color: #102234;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-quick-reply-item-head span,
.line-quick-reply-item-head em {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: #0f766e;
  background: #e6f7f3;
  font-size: 10px;
  font-style: normal;
}

.line-quick-reply-item-head em {
  color: #9a3412;
  background: #fff1e8;
}

.line-quick-reply-body {
  display: -webkit-box;
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-quick-reply-actions {
  display: grid;
  grid-template-columns: repeat(5, 32px);
  gap: 4px;
}

.line-quick-reply-actions .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 7px;
}

.line-quick-reply-actions .danger {
  color: #b42318;
}

.line-quick-reply-empty {
  display: grid;
  min-height: 100px;
  place-items: center;
  padding: 16px;
  color: var(--oc-muted, #64748b);
  font-size: 12px;
  text-align: center;
}

.line-quick-reply-dialog {
  width: min(580px, calc(100vw - 24px));
}

.line-quick-reply-form textarea {
  min-height: 150px;
  resize: vertical;
}

.line-quick-reply-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  #line-page:not(.line-focus-mode) .line-inbox-workspace,
  .line-inbox-workspace,
  .line-page.line-focus-mode .line-inbox-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
  }

  .line-inbox-list-panel,
  .line-inbox-chat-panel,
  .line-inbox-detail-panel {
    grid-column: 1 !important;
    min-width: 0;
    width: 100%;
  }

  #line-page .line-inbox-composer,
  #line-page.line-focus-mode .line-inbox-composer {
    grid-template-columns: minmax(0, 1fr) 68px !important;
    grid-auto-flow: row !important;
    gap: 5px !important;
    padding-right: 7px !important;
    padding-left: 7px !important;
  }

  #line-page .line-inbox-composer .icon-button:not(.line-ai-suggest),
  #line-page .line-inbox-composer .line-sticker-toggle,
  #line-page.line-focus-mode .line-inbox-composer .line-sticker-toggle {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
  }

  #line-page .line-inbox-composer .primary {
    grid-column: auto !important;
    grid-row: auto !important;
    width: auto;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  .line-quick-reply-toolbar .line-quick-reply-favorites,
  .line-quick-reply-toolbar .line-quick-reply-new {
    width: 100%;
  }

  .line-quick-reply-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .line-quick-reply-actions {
    justify-content: end;
  }
}

@media (max-width: 430px) {
  .line-inbox-quick-reply-panel {
    max-height: min(360px, 62vh);
  }

  .line-quick-reply-toolbar {
    grid-template-columns: 1fr;
  }

  .line-quick-reply-item-head {
    flex-wrap: wrap;
  }
}

/* CRM workspace organization pass: compact overview, stable queue, tabbed detail. */
#crm-page.crm-page {
  background: #f5f8fc;
}

#crm-page .crm-page-header {
  min-height: 78px;
  margin-bottom: 0;
  padding: 12px 18px;
  border-radius: 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

#crm-page .crm-page-header h2 {
  font-size: 22px;
}

#crm-page .crm-page-header p {
  max-width: 760px;
  font-size: 12px;
}

#crm-page .crm-page-toolbar {
  top: 78px;
  grid-template-columns: minmax(280px, 1fr) 150px 160px 145px auto;
  gap: 8px;
  margin: 0 14px;
  padding: 9px 10px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

#crm-page .crm-filter-field {
  gap: 3px;
}

#crm-page .crm-filter-field > span {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#crm-page .crm-page-toolbar input,
#crm-page .crm-page-toolbar select,
#crm-page .crm-clear-filters {
  min-height: 36px;
  height: 36px;
}

#crm-page .crm-clear-filters {
  align-self: end;
  padding: 0 12px;
  white-space: nowrap;
}

#crm-page .crm-metrics {
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 7px;
  padding: 10px 14px 0;
}

#crm-page .crm-metric {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 8px;
  min-height: 70px;
  align-content: center;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid #dbe5f0;
  border-left: 3px solid #8ba4bf;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

#crm-page .crm-metric span,
#crm-page .crm-metric small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#crm-page .crm-metric span {
  color: #334155;
  font-size: 11px;
  font-weight: 800;
}

#crm-page .crm-metric small {
  color: #64748b;
  font-size: 10px;
}

#crm-page .crm-metric strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #0f172a;
  font-size: 23px;
  line-height: 1;
}

#crm-page .crm-metric-all,
#crm-page .crm-metric-open {
  border-left-color: #1473ff;
}

#crm-page .crm-metric-due {
  border-left-color: #d97706;
}

#crm-page .crm-metric-at_risk {
  border-left-color: #dc2626;
}

#crm-page .crm-metric-unassigned {
  border-left-color: #64748b;
}

#crm-page .crm-metric-won {
  border-left-color: #059669;
}

#crm-page .crm-metric-lost {
  border-left-color: #94a3b8;
}

#crm-page .crm-metric.active {
  border-color: #1473ff;
  border-left-color: #1473ff;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(20, 115, 255, 0.12);
}

#crm-page .crm-workspace {
  grid-template-columns: minmax(0, 1.62fr) minmax(400px, 0.78fr);
  gap: 10px;
  padding: 10px 14px 14px;
}

#crm-page .crm-board-card,
#crm-page .crm-detail-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: clamp(500px, calc(var(--app-height, 100dvh) - 294px), 720px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-color: #dbe5f0;
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.045);
}

#crm-page .crm-detail-card {
  align-self: stretch;
  max-height: none;
}

#crm-page .crm-section-title {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid #e3eaf2;
  color: #0f172a;
  background: #fff;
}

#crm-page .crm-section-title > span:first-child {
  font-size: 13px;
  font-weight: 900;
}

#crm-page #crm-detail-subtitle,
#crm-page #crm-board-count {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #475569;
  background: #eef3f8;
  font-size: 11px;
  font-weight: 800;
}

#crm-page .crm-board-title-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

#crm-page .crm-board-title-actions label {
  gap: 4px;
  font-size: 10px;
}

#crm-page .crm-board-title-actions label > span {
  color: #64748b;
}

#crm-page .crm-board-title-actions select {
  min-height: 30px;
  height: 30px;
  padding: 0 24px 0 7px;
  font-size: 11px;
}

#crm-page .crm-funnel-board {
  height: 100%;
  min-height: 0;
  padding: 8px;
  background: #f8fafc;
}

#crm-page .crm-funnel-board.list-view {
  height: 100%;
  overflow: auto;
  padding: 8px;
  scrollbar-gutter: stable;
}

#crm-page .crm-list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f4f8;
}

#crm-page .crm-stage-column {
  border-color: #dbe5f0;
  background: #f2f6fa;
}

#crm-page .crm-customer-card,
#crm-page .crm-list-row {
  border-radius: 8px;
  box-shadow: none;
}

#crm-page .crm-customer-card:hover,
#crm-page .crm-list-row:hover {
  border-color: #93bfff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

#crm-page .crm-customer-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

#crm-page .crm-customer-detail > .empty-state {
  grid-row: 1 / -1;
  align-self: stretch;
}

#crm-page .crm-detail-head {
  min-height: 56px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #e3eaf2;
  background: #fff;
}

#crm-page .crm-detail-head strong {
  color: #0f172a;
  font-size: 15px;
}

#crm-page .crm-detail-head span {
  font-size: 11px;
}

#crm-page .crm-detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #e3eaf2;
  background: #f8fafc;
}

#crm-page .crm-detail-tabs button {
  display: inline-flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #64748b;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

#crm-page .crm-detail-tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#crm-page .crm-detail-tabs button b {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: #475569;
  background: #e2e8f0;
  font-size: 10px;
}

#crm-page .crm-detail-tabs button.active {
  border-color: #93bfff;
  color: #0f5fd7;
  background: #eaf3ff;
}

#crm-page .crm-detail-tabs button.active b {
  color: #fff;
  background: #1473ff;
}

#crm-page .crm-detail-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 11px 12px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  scrollbar-gutter: stable;
}

#crm-page .crm-detail-panel[hidden] {
  display: none !important;
}

#crm-page .crm-detail-form,
#crm-page .crm-activity-form {
  gap: 10px;
}

#crm-page .crm-detail-form > label,
#crm-page .crm-detail-form .field-grid > label,
#crm-page .crm-activity-form > label,
#crm-page .crm-activity-form .field-grid > label {
  gap: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

#crm-page .crm-detail-form input,
#crm-page .crm-detail-form select,
#crm-page .crm-activity-form input,
#crm-page .crm-activity-form select {
  min-height: 36px;
}

#crm-page .crm-memory-panel,
#crm-page .crm-tag-editor,
#crm-page .crm-activity-form {
  border-radius: 8px;
}

#crm-page .crm-close-actions {
  grid-template-columns: 1fr;
}

#crm-page .crm-close-actions > div:last-child {
  justify-content: flex-start;
}

#crm-page .crm-activity-history,
#crm-page .crm-line-history {
  gap: 8px;
  padding-top: 2px;
}

@media (max-width: 1500px) {
  #crm-page .crm-metrics {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  #crm-page .crm-workspace {
    grid-template-columns: minmax(0, 1.3fr) minmax(380px, 0.7fr);
  }
}

@media (max-width: 1180px) {
  #crm-page .crm-page-toolbar {
    grid-template-columns: minmax(180px, 1.25fr) repeat(3, minmax(0, 0.75fr));
  }

  #crm-page .crm-clear-filters {
    grid-column: 1 / -1;
    justify-self: end;
  }

  #crm-page .crm-workspace {
    grid-template-columns: 1fr;
  }

  #crm-page .crm-board-card,
  #crm-page .crm-detail-card {
    height: min(660px, calc(var(--app-height, 100dvh) - 230px));
  }
}

@media (max-width: 760px) {
  .app-shell.crm-mode {
    grid-template-columns: 1fr;
    padding: 0;
  }

  #crm-page.crm-page {
    grid-column: 1;
  }

  #crm-page .crm-page-header {
    flex: 0 0 auto;
    min-height: 0;
    padding: max(10px, env(safe-area-inset-top)) 10px 9px;
  }

  #crm-page .crm-page-header p {
    display: none;
  }

  #crm-page .crm-page-toolbar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 10px 0;
    padding: 8px;
  }

  #crm-page .crm-search-field,
  #crm-page .crm-clear-filters {
    grid-column: 1 / -1;
  }

  #crm-page .crm-clear-filters {
    width: 100%;
  }

  #crm-page .crm-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px 10px 0;
  }

  #crm-page .crm-metric {
    min-height: 64px;
  }

  #crm-page .crm-workspace {
    gap: 10px;
    padding: 8px 10px 12px;
  }

  #crm-page .crm-board-card,
  #crm-page .crm-detail-card {
    height: min(640px, calc(var(--app-height, 100dvh) - 120px));
  }

  #crm-page .crm-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  #crm-page .crm-board-title-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  #crm-page #crm-board-count {
    grid-column: 1 / -1;
    justify-self: start;
  }

  #crm-page .crm-board-title-actions label {
    display: grid;
  }

  #crm-page .crm-board-title-actions select {
    width: 100%;
  }

  #crm-page .crm-detail-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #crm-page .crm-memory-grid,
  #crm-page .field-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep the employee file wider than the generic .modal rule declared above. */
dialog.modal.hr-employee-dialog {
  width: min(1180px, calc(100vw - 24px));
  max-width: none;
  height: min(920px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

dialog.modal.hr-v2-review-dialog,
dialog.modal.hr-v2-payroll-edit-dialog,
dialog.modal.hr-v2-payroll-close-dialog {
  width: min(860px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

dialog.modal.hr-v2-review-dialog {
  width: min(680px, calc(100vw - 24px));
}

.hr-v2-review-dialog-form,
.hr-v2-payroll-edit-form,
.hr-v2-payroll-close-form {
  display: grid;
  gap: 14px;
  max-height: calc(100dvh - 26px);
  padding: 18px;
  overflow: auto;
  background: #fff;
  overscroll-behavior: contain;
}

.hr-v2-review-dialog-form > header,
.hr-v2-payroll-edit-form > header,
.hr-v2-payroll-close-form > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.hr-v2-review-dialog-form header h2,
.hr-v2-review-dialog-form header p,
.hr-v2-payroll-edit-form header h2,
.hr-v2-payroll-edit-form header p,
.hr-v2-payroll-close-form header h2,
.hr-v2-payroll-close-form header p {
  margin: 2px 0 0;
}

.hr-v2-review-dialog-form header h2,
.hr-v2-payroll-edit-form header h2,
.hr-v2-payroll-close-form header h2 {
  color: #0f172a;
  font-size: 20px;
}

.hr-v2-review-dialog-form header p,
.hr-v2-payroll-edit-form header p,
.hr-v2-payroll-close-form header p {
  color: var(--muted);
  font-size: 13px;
}

.hr-v2-review-dialog-form > footer,
.hr-v2-payroll-edit-form > footer,
.hr-v2-payroll-close-form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.hr-v2-overtime-dialog-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hr-v2-overtime-dialog-detail > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.hr-v2-overtime-dialog-detail span {
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-overtime-dialog-detail strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.hr-v2-review-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hr-v2-review-fields small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.hr-v2-review-fields input[readonly],
.hr-v2-payroll-edit-group input[readonly] {
  border-color: #e2e8f0;
  color: #64748b;
  background: #f1f5f9;
  cursor: not-allowed;
}

.hr-v2-payroll-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.hr-v2-payroll-edit-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.hr-v2-payroll-edit-group legend {
  padding: 0 6px;
  font-size: 14px;
  font-weight: 900;
}

.hr-v2-payroll-edit-group.is-earning legend {
  color: #15803d;
}

.hr-v2-payroll-edit-group.is-deduction legend {
  color: #dc2626;
}

.hr-v2-payroll-locked-note {
  display: grid;
  gap: 7px;
  justify-items: start;
  margin-top: -5px;
  padding: 7px 9px;
  border-radius: 7px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 11px;
  line-height: 1.45;
}

.hr-v2-payroll-locked-note button {
  min-height: 30px;
}

.hr-v2-attendance-breakdown {
  min-width: 0;
}

.hr-v2-attendance-breakdown-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #7f1d1d;
  background: #fff7f7;
  font-size: 11px;
  line-height: 1.45;
}

.hr-v2-attendance-breakdown-card > strong {
  color: #991b1b;
  font-size: 12px;
}

.hr-v2-attendance-breakdown-card > ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hr-v2-attendance-breakdown-card li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed #fecaca;
}

.hr-v2-attendance-breakdown-card li > span {
  min-width: 0;
}

.hr-v2-attendance-breakdown-card li small,
.hr-v2-attendance-override small {
  display: block;
  margin-top: 2px;
  color: #7c2d12;
  overflow-wrap: anywhere;
}

.hr-v2-attendance-breakdown-card li > strong {
  color: #991b1b;
  white-space: nowrap;
}

.hr-v2-attendance-override {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 6px;
  color: #78350f;
  background: #fffbeb;
}

.hr-v2-attendance-breakdown-card.is-compact {
  margin-top: 5px;
  padding: 7px 8px;
  border-color: #cbd5e1;
  color: #334155;
  background: #fff;
}

.hr-v2-attendance-breakdown-card.is-compact > strong,
.hr-v2-attendance-breakdown-card.is-compact li > strong {
  color: #172033;
}

.hr-v2-attendance-breakdown-card.is-compact li {
  border-top-color: #e2e8f0;
}

.hr-v2-attendance-empty {
  display: block;
  padding: 7px 9px;
  border-radius: 7px;
  color: #166534;
  background: #f0fdf4;
}

.hr-v2-payroll-edit-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}

.hr-v2-payroll-edit-totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.hr-v2-payroll-edit-totals > div:last-child {
  border-right: 0;
}

.hr-v2-payroll-edit-totals span {
  color: var(--muted);
  font-size: 12px;
}

.hr-v2-payroll-edit-totals strong {
  color: #0f172a;
  white-space: nowrap;
}

.hr-v2-payroll-edit-totals .net {
  background: #ecfdf5;
}

.hr-v2-payroll-edit-totals .net strong {
  color: #047857;
  font-size: 18px;
}

.hr-v2-dialog-feedback {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #fff1f2;
  font-size: 13px;
  line-height: 1.45;
}

.hr-v2-payroll-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.hr-v2-payroll-status.is-locked {
  color: #92400e;
  background: #fef3c7;
}

.hr-v2-payroll-status.is-paid {
  color: #047857;
  background: #d1fae5;
}

.hr-v2-payroll-status.is-archived {
  color: #64748b;
  background: #e2e8f0;
}

.hr-v2-payroll-lifecycle-meta {
  color: #334155;
  overflow-wrap: anywhere;
}

.hr-v2-payroll-close-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.hr-v2-payroll-close-panel > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hr-v2-payroll-close-panel > div > strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: #1e3a8a;
}

.hr-v2-payroll-close-panel.is-locked {
  border-color: #fde68a;
  background: #fffbeb;
}

.hr-v2-payroll-close-panel.is-locked > div > strong {
  color: #92400e;
}

.hr-v2-payroll-close-panel.is-paid {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.hr-v2-payroll-close-panel.is-paid > div > strong {
  color: #065f46;
}

.hr-v2-payroll-close-summary,
.hr-v2-payroll-close-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hr-v2-payroll-close-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}

.hr-v2-payroll-close-summary span,
.hr-v2-payroll-payment-fields small {
  color: var(--muted);
  font-size: 11px;
}

.hr-v2-payroll-close-summary strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.hr-v2-payroll-close-warnings {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 9px;
  color: #166534;
  background: #f0fdf4;
  font-size: 12px;
  line-height: 1.45;
}

.hr-v2-payroll-close-warnings.has-warnings {
  max-height: min(260px, 32dvh);
  overflow: auto;
  border-color: #fbbf24;
  color: #92400e;
  background: #fffbeb;
}

.hr-v2-payroll-close-warnings ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
}

.hr-v2-payroll-payment-fields {
  display: grid;
  gap: 11px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  background: #f0fdf4;
}

.hr-v2-payroll-payment-fields legend {
  padding: 0 6px;
  color: #047857;
  font-size: 14px;
  font-weight: 900;
}

.hr-v2-payroll-close-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-v2-payroll-close-ack {
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  color: #1e3a8a;
  background: #eff6ff;
  font-weight: 800;
  line-height: 1.45;
}

.hr-v2-payroll-close-ack.is-warning {
  border-color: #fbbf24;
  color: #92400e;
  background: #fffbeb;
}

.hr-v2-payroll-close-ack input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.hr-v2-payroll-close-safety-note {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  dialog.modal.hr-employee-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  dialog.modal.hr-v2-review-dialog,
  dialog.modal.hr-v2-payroll-edit-dialog,
  dialog.modal.hr-v2-payroll-close-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .hr-v2-review-dialog-form,
  .hr-v2-payroll-edit-form,
  .hr-v2-payroll-close-form {
    max-height: 100dvh;
    min-height: 100dvh;
    padding: 14px;
  }

  .hr-v2-overtime-filter,
  .hr-v2-overtime-dialog-detail,
  .hr-v2-review-fields,
  .hr-v2-payroll-edit-grid,
  .hr-v2-payroll-edit-totals,
  .hr-v2-payroll-close-summary,
  .hr-v2-payroll-close-field-grid {
    grid-template-columns: 1fr;
  }

  .hr-v2-overtime-filter button {
    width: 100%;
  }

  .hr-v2-payroll-edit-totals > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hr-v2-payroll-edit-totals > div:last-child {
    border-bottom: 0;
  }

  .hr-v2-payroll-close-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-v2-payroll-close-panel > button {
    width: 100%;
  }
}

/* Per-user room pinning: pinned Office chats stay visible without adding a nested button. */
.conversation-side {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: end;
}

.conversation-pin-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #b45309;
  background: #fff7d6;
}

.conversation-pin-mark .ui-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
}

.conversation-item.pinned:not(.active) {
  border-color: rgba(180, 83, 9, 0.18);
  background: linear-gradient(180deg, #fffdf5, #ffffff);
}

.pin-conversation-button.is-pinned {
  color: #9a4f08;
  border-color: rgba(180, 83, 9, 0.34);
  background: linear-gradient(180deg, #fff7d6, #fffdf5);
}

.pin-conversation-button.is-pinned .ui-icon {
  fill: currentColor;
  stroke: currentColor;
}

@media (max-width: 430px) {
  .chat-title-block {
    min-width: 0;
  }

  .chat-header-actions {
    gap: 2px;
  }

  .chat-header .icon-button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 6px;
  }
}
