﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f5f7fb;
}

/* Activity log / audit trail */
.activity-log-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px;
}

.activity-log-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #2563eb 52%, #7c3aed 100%);
    box-shadow: 0 22px 55px rgba(37, 99, 235, 0.22);
}

.activity-log-hero h1 {
    margin: 6px 0;
    font-size: clamp(30px, 3vw, 46px);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.activity-log-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.activity-log-time {
    flex: 0 0 auto;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 800;
    white-space: nowrap;
}

.activity-log-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.activity-log-stats > div {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.activity-log-stats span,
.activity-log-stats small {
    display: block;
    color: #64748b;
    font-weight: 800;
}

.activity-log-stats strong {
    display: block;
    margin: 4px 0;
    color: #0f172a;
    font-size: 30px;
    font-weight: 950;
}

.activity-log-panel {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
}

.activity-log-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 190px 150px auto auto;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.88);
}

.activity-log-list {
    max-height: calc(100vh - 390px);
    min-height: 420px;
    overflow: auto;
    padding: 10px;
}

.activity-log-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 260px;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    background: #fff;
}

.activity-log-row + .activity-log-row {
    margin-top: 10px;
}

.activity-log-dot {
    width: 12px;
    height: 12px;
    margin-top: 8px;
    border-radius: 999px;
    background: #64748b;
    box-shadow: 0 0 0 6px rgba(100, 116, 139, 0.12);
}

.activity-log-dot.status,
.activity-log-badge.status { background: #f97316; }

.activity-log-dot.assigned,
.activity-log-badge.assigned { background: #7c3aed; }

.activity-log-dot.task,
.activity-log-badge.task { background: #16a34a; }

.activity-log-dot.ticket,
.activity-log-badge.ticket { background: #dc2626; }

.activity-log-dot.message,
.activity-log-badge.message { background: #2563eb; }

.activity-log-dot.note,
.activity-log-badge.note { background: #0f766e; }

.activity-log-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}

.activity-log-title strong {
    font-size: 17px;
    font-weight: 900;
}

.activity-log-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.activity-log-main p {
    margin: 8px 0 10px;
    color: #334155;
}

.activity-log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-log-meta span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.activity-log-customer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 14px;
    border-left: 1px solid #e2e8f0;
}

.activity-log-customer strong {
    color: #0f172a;
    font-weight: 950;
}

.activity-log-customer span {
    color: #64748b;
    font-size: 13px;
}

.activity-log-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.activity-log-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 320px;
    color: #64748b;
    text-align: center;
}

.activity-log-empty strong {
    color: #0f172a;
    font-size: 18px;
}

@media (max-width: 1200px) {
    .activity-log-hero,
    .activity-log-filter {
        grid-template-columns: 1fr;
    }

    .activity-log-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .activity-log-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-log-row {
        grid-template-columns: 14px minmax(0, 1fr);
    }

    .activity-log-customer {
        grid-column: 2;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
    }
}

body.has-sidebar {
  margin: 0;
  background: #f5f7fb;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #dde6f2;
  padding: 1rem;
  background:
    radial-gradient(circle at 0 0, rgba(13, 110, 253, .16), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 12px 0 34px rgba(15, 23, 42, .06);
  overflow: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  border-radius: 18px;
  padding: .6rem;
  color: #10233f;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: #0d6efd;
  background: #f2f7ff;
}

.sidebar-nav {
  display: grid;
  gap: .35rem;
  margin-top: 1.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: .65rem .75rem;
  color: #334155;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.sidebar-link:hover,
.sidebar-link:focus {
  border-color: #dbe8ff;
  background: #eef5ff;
  color: #0d6efd;
  transform: translateX(2px);
}

.sidebar-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #f1f5f9;
  font-size: 1rem;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link:focus .sidebar-icon {
  background: #dceaff;
}

.sidebar-footer {
  display: grid;
  gap: .75rem;
  margin-top: auto;
  border-top: 1px solid #e8edf5;
  padding-top: 1rem;
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-user-name {
  min-width: 0;
  color: #334155;
  font-size: .9rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-content {
  min-width: 0;
  padding: 1.25rem;
}

body.auth-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(13, 110, 253, .24), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(111, 66, 193, .2), transparent 26%),
    linear-gradient(135deg, #eef5ff 0%, #f8fbff 42%, #eef2f7 100%);
}

.auth-container {
  min-height: 100vh;
}

.auth-container main {
  min-height: 100vh;
  padding: 0 !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  margin-bottom: 1rem;
  background: rgba(245, 247, 251, .88);
  backdrop-filter: blur(14px);
}

.app-navbar {
  min-height: 74px;
  border-bottom: 1px solid rgba(210, 218, 231, .8);
  background:
    radial-gradient(circle at 0 0, rgba(13, 110, 253, .12), transparent 32%),
    linear-gradient(180deg, #ffffff, rgba(255, 255, 255, .92));
  box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-width: 210px;
  margin-right: 1rem;
  color: #10233f;
  text-decoration: none;
}

.app-brand:hover {
  color: #0d6efd;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(13, 110, 253, .24);
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.05;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-subtitle {
  margin-top: .2rem;
  color: #6c757d;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.app-menu {
  display: grid;
  grid-template-columns: repeat(8, minmax(92px, 1fr));
  gap: .35rem;
  width: min(1120px, 100%);
  padding: .3rem;
  border: 1px solid #e4eaf3;
  border-radius: 999px;
  background: #f8fbff;
}

.app-menu .nav-item {
  min-width: 0;
}

.app-menu .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  padding: .55rem .85rem;
  color: #334155;
  font-size: .92rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.app-menu .nav-link:hover,
.app-menu .nav-link:focus {
  background: #eaf2ff;
  color: #0d6efd;
}

.app-header-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 120px;
  margin-left: 1rem;
  border: 1px solid #dce8dc;
  border-radius: 999px;
  padding: .55rem .85rem;
  background: #f2fbf5;
  color: #146c43;
  font-size: .84rem;
  font-weight: 800;
}

.logout-form {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-left: 1rem;
  white-space: nowrap;
}

.user-chip {
  border: 1px solid #dfe5ee;
  border-radius: 999px;
  padding: .42rem .75rem;
  background: #fff;
  color: #334155;
  font-size: .84rem;
  font-weight: 700;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid #dfe5ee;
  border-radius: 22px;
  padding: 1.35rem;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1.25rem;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 850;
}

.auth-brand p,
.page-title p {
  margin: .25rem 0 0;
  color: #6c757d;
}

.auth-form,
.form-card {
  display: grid;
  gap: 1rem;
}

.auth-note {
  margin-top: 1rem;
  border-radius: 12px;
  padding: .75rem;
  background: #f8fafc;
  color: #6c757d;
  font-size: .88rem;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(380px, 520px);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  width: min(1180px, calc(100vw - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.login-screen-simple {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
  width: 100%;
}

.login-splash {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .55rem;
  background:
    radial-gradient(circle at 50% 38%, rgba(13, 110, 253, .22), transparent 26%),
    linear-gradient(135deg, #f8fbff, #eef5ff);
  color: #10233f;
  animation: splash-hide 2.2s ease forwards;
}

.login-splash-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  font-size: 2rem;
  font-weight: 950;
  box-shadow: 0 22px 46px rgba(13, 110, 253, .28);
  animation: splash-pop .9s cubic-bezier(.2, .9, .2, 1) both;
}

.login-splash-text {
  color: #526174;
  font-size: 1rem;
  font-weight: 800;
  animation: splash-rise .8s ease .15s both;
}

.login-splash-title {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.055em;
  animation: splash-rise .8s ease .25s both;
}

@keyframes splash-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.82);
  }

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

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@keyframes splash-hide {
  0%,
  72% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-splash {
    display: none;
  }
}

.login-hero {
  color: #10233f;
}

.login-logo {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 900;
  box-shadow: 0 18px 38px rgba(13, 110, 253, .28);
}

.login-kicker {
  margin: 1.4rem 0 .65rem;
  color: #0d6efd;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-hero h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2.15rem, 4vw, 4.4rem);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -.055em;
}

.login-description {
  max-width: 560px;
  margin: 1.1rem 0 0;
  color: #526174;
  font-size: 1.08rem;
  line-height: 1.7;
}

.login-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.5rem;
}

.login-feature-list span {
  border: 1px solid rgba(13, 110, 253, .16);
  border-radius: 999px;
  padding: .48rem .8rem;
  background: rgba(255, 255, 255, .72);
  color: #334155;
  font-size: .86rem;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.login-card {
  border: 1px solid rgba(217, 226, 239, .95);
  border-radius: 28px;
  padding: clamp(1.35rem, 3vw, 2rem);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 28px 70px rgba(15, 23, 42, .15);
  backdrop-filter: blur(18px);
}

.login-card-simple {
  width: min(440px, calc(100vw - 2rem));
}

.login-card-header {
  margin-bottom: 1.35rem;
}

.login-card-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -.035em;
}

.login-card-header p {
  margin: .35rem 0 0;
  color: #6c757d;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-field label {
  display: block;
  margin-bottom: .42rem;
  color: #334155;
  font-size: .9rem;
  font-weight: 800;
}

.login-field .form-control {
  min-height: 52px;
  border-color: #dbe4f0;
  border-radius: 14px;
  font-size: .98rem;
}

.login-field .form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .24rem rgba(13, 110, 253, .12);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #526174;
  font-size: .92rem;
}

.login-remember {
  color: #526174;
  font-size: .92rem;
}

.login-card .btn-primary {
  min-height: 52px;
  border-radius: 14px;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(13, 110, 253, .22);
}

.page-shell {
  display: grid;
  gap: 1rem;
}

.page-shell.narrow {
  max-width: 760px;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0 .5rem;
}

.page-title h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 850;
  letter-spacing: -.02em;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) auto;
  gap: .75rem;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  padding: .85rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.filter-bar.wide {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(170px, 220px) auto;
}

.table-card,
.form-card {
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.form-card {
  padding: 1rem;
  overflow: visible;
}

.table-card .table thead th {
  border-bottom: 1px solid #eef2f6;
  background: #fbfcfe;
  color: #495057;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.table-card .table td,
.table-card .table th {
  padding: .9rem 1rem;
}

.conversation-table-preview {
  max-width: 360px;
}

.customer-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 1rem;
}

.customer-filter {
  grid-template-columns: minmax(240px, 1fr) minmax(120px, 150px) minmax(145px, 180px) minmax(125px, 160px) minmax(165px, 210px) auto;
}

.conversation-filter {
  grid-template-columns: minmax(320px, 1fr) minmax(130px, 160px) minmax(150px, 190px) minmax(190px, 240px) auto;
}

.conversation-results-card {
  overflow: hidden;
}

.conversation-results-card .table-card-header.compact {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #edf2f7;
}

.conversation-results-card .table-card-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 950;
}

.conversation-results-card .table-card-header p {
  margin: .2rem 0 0;
  color: #64748b;
}

.conversation-table-scroll {
  max-height: calc(100vh - 310px);
  min-height: 520px;
  overflow: auto;
}

.conversation-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 #edf2f7;
}

.conversation-table-scroll tbody tr {
  transition: .16s ease;
}

.conversation-table-scroll tbody tr:hover {
  background: #f8fbff;
}

.role-inline-form {
  min-width: 150px;
}

.role-inline-form .form-select {
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  color: #334155;
  background-color: #f8fbff;
}

.permission-readonly-card {
  display: grid;
  gap: .25rem;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: .8rem .95rem;
  background: #f8fbff;
}

.permission-readonly-card strong {
  color: #1d4ed8;
}

.permission-readonly-card span {
  color: #64748b;
  font-size: .9rem;
}

.customer-tags {
  display: inline-flex;
  width: fit-content;
  margin-top: .35rem;
  border-radius: 999px;
  padding: .1rem .55rem;
  background: #f1f5f9;
  color: #475569;
  font-size: .76rem;
  font-weight: 700;
}

.customer-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .18rem .62rem;
  font-size: .76rem;
  font-weight: 800;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #495057;
  white-space: nowrap;
}

.status-customer-new {
  border-color: #b6d4fe;
  background: #eef6ff;
  color: #084298;
}

.status-customer-potential {
  border-color: #ffda6a;
  background: #fff8df;
  color: #997404;
}

.status-customer-active {
  border-color: #badbcc;
  background: #edf9f2;
  color: #0f5132;
}

.status-customer-vip {
  border-color: #e0cffc;
  background: #f6f0ff;
  color: #5a23a7;
}

.status-customer-blocked {
  border-color: #f5c2c7;
  background: #fff1f2;
  color: #b02a37;
}

.table-actions {
  display: inline-flex;
  gap: .4rem;
  justify-content: flex-end;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(320px, 1.1fr);
  gap: 1rem;
}

.customer-360-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 1rem;
}

.customer-work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 1rem;
}

.customer-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.detail-card {
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.detail-card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 850;
}

.detail-list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: .65rem 1rem;
  margin: 0;
}

.detail-list dt {
  color: #6c757d;
  font-size: .86rem;
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
}

.customer-note {
  min-height: 180px;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  padding: .85rem;
  background: #fbfcfe;
  color: #334155;
  white-space: pre-wrap;
}

.customer-form {
  gap: 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.form-section-title {
  color: #334155;
  font-size: .95rem;
  font-weight: 900;
  margin: .25rem 0 -.25rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.lead-score {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 34px;
  border-radius: 999px;
  padding: 0 .75rem;
  background: #eef6ff;
  color: #0b5ed7;
  font-weight: 900;
}

.lead-score.big {
  min-width: 60px;
  height: 60px;
  border-radius: 20px;
  font-size: 1.4rem;
}

.customer-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.customer-insight-grid > div {
  border: 1px solid #eef2f6;
  border-radius: 14px;
  padding: .8rem;
  background: #fbfcfe;
}

.customer-insight-grid span {
  display: block;
  color: #6c757d;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.customer-insight-grid strong {
  color: #212529;
}

.stack-form {
  display: grid;
  gap: .65rem;
}

.activity-timeline {
  display: grid;
  gap: .85rem;
  padding: 1rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: .75rem;
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: .35rem;
  border-radius: 999px;
  background: #0d6efd;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .12);
}

.activity-content {
  margin-top: .35rem;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  padding: .6rem .7rem;
  background: #fbfcfe;
  white-space: pre-wrap;
}

.status-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: #20c997;
  box-shadow: 0 0 0 .25rem rgba(32, 201, 151, .14);
}

.app-toggler {
  border: 1px solid #dce3ef;
  border-radius: 12px;
  padding: .45rem .6rem;
  background: #fff;
}

.panel {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.25rem;
  background: #fff;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #edf0f2;
  padding-bottom: .85rem;
}

.muted-panel {
  background: #f8f9fa;
}

.source-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 0;
  border-top: 1px solid #e5e7eb;
}

.source-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.source-dot {
  width: .85rem;
  height: .85rem;
  border-radius: 999px;
  margin-top: .25rem;
  background: #6c757d;
  flex: 0 0 auto;
}

.source-dot.zalo {
  background: #0d6efd;
}

.source-dot.viber {
  background: #6f42c1;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 1rem;
}

.channel-card {
  min-height: 100%;
}

.channel-badge {
  border-radius: 999px;
  padding: .25rem .65rem;
  background: #eef2f6;
  color: #495057;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.channel-badge.ready {
  background: #edf9f2;
  color: #0f5132;
}

.channel-badge.pending {
  background: #fff8df;
  color: #997404;
}

.channel-badge.missing {
  background: #fff1f2;
  color: #b02a37;
}

.config-list {
  display: grid;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  overflow: hidden;
}

.config-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .75rem;
  border-top: 1px solid #eef2f6;
  background: #fff;
}

.config-row:first-child {
  border-top: 0;
}

.config-row span:first-child {
  color: #495057;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .84rem;
}

.config-state {
  font-weight: 700;
  font-size: .86rem;
}

.config-state.ok {
  color: #198754;
}

.config-state.warn {
  color: #dc3545;
}

.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.metric {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  min-height: 92px;
  background: #fff;
}

.metric span {
  display: block;
  font-size: 1.75rem;
  line-height: 1.1;
  font-weight: 700;
}

.metric small {
  color: #6c757d;
}

.dashboard-shell {
  display: grid;
  gap: 1rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1rem;
}

.dashboard-grid.ops-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.dashboard-grid.employee-summary-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.stat-card {
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.stat-card span {
  display: block;
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 750;
}

.stat-card strong {
  display: block;
  margin: .2rem 0;
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 850;
}

.stat-card small {
  color: #6c757d;
}

.accent-blue {
  border-top: 3px solid #0d6efd;
}

.accent-red {
  border-top: 3px solid #dc3545;
}

.accent-yellow {
  border-top: 3px solid #ffc107;
}

.accent-green {
  border-top: 3px solid #198754;
}

.accent-cyan {
  border-top: 3px solid #0dcaf0;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 1rem;
}

.dashboard-panels.ops-panels {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.dashboard-panels.ops-panels.wide {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.dashboard-panel {
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eef2f6;
}

.status-bars {
  display: grid;
  gap: .85rem;
  padding: 1rem;
}

.status-bar-row {
  display: grid;
  gap: .35rem;
  font-size: .9rem;
}

.status-track {
  height: .55rem;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.status-fill {
  height: 100%;
  border-radius: 999px;
  background: #6c757d;
}

.status-fill-new {
  background: #dc3545;
}

.status-fill-inprogress {
  background: #ffc107;
}

.status-fill-resolved {
  background: #198754;
}

.status-fill-callback {
  background: #0dcaf0;
}

.dashboard-list {
  display: grid;
}

.dashboard-list.compact-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.dashboard-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1rem;
  border-bottom: 1px solid #eef2f6;
  color: #212529;
  text-decoration: none;
}

.dashboard-list-item:hover {
  background: #f5f9ff;
}

.ops-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .16rem .6rem;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #495057;
  font-size: .76rem;
  font-weight: 850;
  white-space: nowrap;
}

.ops-pill.danger {
  border-color: #f5c2c7;
  background: #fff1f2;
  color: #b02a37;
}

.ops-pill.warning {
  border-color: #ffda6a;
  background: #fff8df;
  color: #997404;
}

.ops-pill.info {
  border-color: #b6d4fe;
  background: #eef6ff;
  color: #084298;
}

.ops-pill.success {
  border-color: #badbcc;
  background: #effaf3;
  color: #0f5132;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eef2f6;
}

.table-card-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 850;
}

.table-card-header p {
  margin: .2rem 0 0;
  color: #6c757d;
}

.employee-table {
  min-width: 1040px;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.employee-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 850;
  text-transform: uppercase;
}

.employee-form-card {
  display: grid;
  gap: 1rem;
}

.employee-profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.employee-profile-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.employee-profile-main h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 850;
}

.employee-profile-main p {
  margin: .15rem 0 .55rem;
  color: #6c757d;
}

.employee-avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  font-size: 1.4rem;
}

.employee-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 1rem;
}

.transfer-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.transfer-card h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 850;
}

.transfer-card p {
  margin: .2rem 0 0;
  color: #6c757d;
}

.transfer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: .75rem;
}

.transfer-actions form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.inbox-shell {
  display: grid;
  grid-template-columns: clamp(320px, 30vw, 390px) minmax(0, 1fr);
  gap: 1rem;
  min-height: calc(100vh - 140px);
}

.inbox-shell-three {
  grid-template-columns: clamp(270px, 22vw, 340px) minmax(420px, 1fr) clamp(280px, 23vw, 360px);
  min-height: calc(100vh - 2.5rem);
}

.inbox-list,
.message-pane,
.customer-profile-pane {
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #fff;
  min-width: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.inbox-list {
  overflow: hidden;
}

.customer-profile-pane {
  overflow: hidden auto;
  padding: 1rem;
}

.inbox-list-header,
.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.15rem;
  border-bottom: 1px solid #e8edf5;
  background: #fff;
}

.inbox-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
}

.inbox-live-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid #dce8dc;
  border-radius: 999px;
  padding: .35rem .65rem;
  background: #f2fbf5;
  color: #146c43;
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}

.inbox-live-status::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-radius: 999px;
  background: #20c997;
  box-shadow: 0 0 0 .18rem rgba(32, 201, 151, .14);
}

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

.conversation-list {
  max-height: calc(100vh - 315px);
  overflow: auto;
}

.inbox-search {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 150px) auto;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eef2f6;
  background: #fbfcfe;
}

.channel-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid #eef2f6;
  background: #fbfcfe;
}

.channel-filter-card {
  display: grid;
  gap: .25rem;
  min-height: 78px;
  align-content: center;
  justify-items: center;
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  padding: .75rem .5rem;
  background: #fff;
  color: #263345;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.channel-filter-card:hover,
.channel-filter-card.active {
  border-color: #b8cff7;
  background: #f5f9ff;
  color: #0d6efd;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(13, 110, 253, .09);
}

.channel-filter-name {
  font-weight: 800;
}

.channel-filter-count {
  min-width: 28px;
  border-radius: 999px;
  padding: .1rem .55rem;
  background: #eef2f6;
  color: #495057;
  font-size: .82rem;
  font-weight: 800;
}

.channel-filter-card.active .channel-filter-count {
  background: #0d6efd;
  color: #fff;
}

.conversation-section-title {
  padding: .55rem 1.1rem;
  border-bottom: 1px solid #eef2f6;
  color: #6c757d;
  font-size: .82rem;
  font-weight: 700;
  background: #fff;
}

.status-form {
  display: grid;
  grid-template-columns: minmax(130px, 160px) auto;
  gap: .5rem;
  align-items: center;
}

.sync-alert {
  margin: .85rem 1rem 0;
  border: 1px solid #b6d4fe;
  border-radius: 8px;
  padding: .65rem .75rem;
  background: #eef6ff;
  color: #084298;
  font-size: .9rem;
}

.conversation-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #eef2f6;
  color: #212529;
  text-decoration: none;
}

.conversation-item:hover,
.conversation-item.active {
  background: #eef5ff;
}

.conversation-item.active {
  box-shadow: inset 3px 0 0 #0d6efd;
}

.conversation-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.conversation-body {
  min-width: 0;
  flex: 1;
}

.conversation-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.platform-pill {
  border: 1px solid #d6e4ff;
  border-radius: 999px;
  padding: .08rem .5rem;
  background: #f4f8ff;
  color: #0b5ed7;
  font-size: .75rem;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: .1rem .55rem;
  margin-top: .35rem;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #495057;
}

.status-new {
  border-color: #f5c2c7;
  background: #fff1f2;
  color: #b02a37;
}

.status-inprogress {
  border-color: #ffda6a;
  background: #fff8df;
  color: #997404;
}

.status-resolved {
  border-color: #badbcc;
  background: #edf9f2;
  color: #0f5132;
}

.status-callback {
  border-color: #b6d4fe;
  background: #eef6ff;
  color: #084298;
}

.conversation-preview {
  color: #6c757d;
  margin-top: .35rem;
}

.conversation-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #6c757d;
  font-size: .82rem;
  margin-top: .45rem;
}

.message-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-info-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #ffe8a3;
  padding: .8rem 1rem;
  background: #fff8df;
  color: #614d00;
}

.customer-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .45rem;
}

.customer-checklist span {
  border-radius: 999px;
  padding: .12rem .55rem;
  font-size: .75rem;
  font-weight: 800;
}

.customer-checklist span.done {
  border: 1px solid #badbcc;
  background: #edf9f2;
  color: #0f5132;
}

.customer-checklist span.done::before {
  content: "✓ ";
}

.customer-checklist span.missing {
  border: 1px solid #f5c2c7;
  background: #fff1f2;
  color: #b02a37;
}

.customer-checklist span.missing::before {
  content: "! ";
}

.message-list {
  padding: 1.35rem;
  overflow: auto;
  max-height: calc(100vh - 265px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.92)),
    repeating-linear-gradient(135deg, #eef2f7 0, #eef2f7 1px, transparent 1px, transparent 14px);
  flex: 1;
}

.profile-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: .85rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eef2f6;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-subline {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.profile-section {
  padding: 1rem 0;
  border-bottom: 1px solid #eef2f6;
}

.profile-section-title {
  color: #495057;
  font-size: .82rem;
  font-weight: 800;
  margin-bottom: .65rem;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.customer-checklist.compact {
  gap: .35rem;
}

.profile-info-list {
  display: grid;
  gap: .65rem;
}

.profile-info-list > div {
  display: grid;
  gap: .15rem;
}

.profile-info-list span {
  color: #6c757d;
  font-size: .78rem;
}

.profile-info-list strong {
  color: #212529;
  font-size: .92rem;
  font-weight: 700;
  word-break: break-word;
}

.profile-note {
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: .75rem;
  min-height: 82px;
  background: #fbfcfe;
  color: #495057;
  white-space: pre-wrap;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
  padding: 1rem 0 0;
}

.quick-customer-form {
  display: grid;
  gap: .58rem;
}

.quick-customer-form .form-label {
  color: #64748b;
  font-weight: 800;
}

.quick-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.profile-recent-list {
  display: grid;
  gap: .55rem;
}

.profile-recent-item {
  display: grid;
  gap: .18rem;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: .7rem;
  background: #fbfcfe;
  color: #212529;
  text-decoration: none;
}

.profile-recent-item:hover {
  border-color: #b8cff7;
  background: #f5f9ff;
  color: #0d6efd;
}

.message-row {
  display: flex;
  margin-bottom: .85rem;
}

.message-row.message-live .message-bubble {
  animation: message-pop .45s ease-out;
}

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

.message-bubble {
  max-width: min(720px, 78%);
  border: 1px solid #dfe5ee;
  border-radius: 18px 18px 18px 6px;
  padding: .78rem .95rem;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.message-row.outgoing .message-bubble {
  background: #e8f2ff;
  border-color: #cfe2ff;
  border-radius: 18px 18px 6px 18px;
}

.message-sender {
  color: #495057;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-time {
  color: #6c757d;
  font-size: .76rem;
  text-align: right;
  margin-top: .45rem;
}

@keyframes message-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

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

.reply-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: end;
  padding: 1rem;
  border-top: 1px solid #e8edf5;
  background: #fff;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .55rem;
}

.quick-reply-btn {
  border: 1px solid #d6e4ff;
  border-radius: 999px;
  padding: .32rem .7rem;
  background: #f8fbff;
  color: #0b5ed7;
  font-size: .8rem;
  font-weight: 700;
}

.quick-reply-btn:hover {
  border-color: #0d6efd;
  background: #eef5ff;
}

.reply-box textarea {
  resize: vertical;
  min-height: 46px;
  max-height: 160px;
}

.reply-hint {
  color: #6c757d;
  font-size: .78rem;
  margin-top: .35rem;
}

.empty-state {
  color: #6c757d;
  padding: 1rem;
}

.empty-state.large {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

/* Modern overview + executive dashboard */
.overview-page,
.ops-dashboard {
  display: grid;
  gap: 1.25rem;
}

.overview-hero,
.ops-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  gap: 2rem;
  align-items: center;
  min-height: 360px;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 18%, rgba(125, 211, 252, .55), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(196, 181, 253, .48), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 48%, #7c3aed 100%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.ops-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 230px;
}

.overview-hero::after,
.ops-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% 28%;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  filter: blur(4px);
  transform: rotate(-6deg);
}

.overview-hero-content,
.overview-hero-card,
.ops-hero > * {
  position: relative;
  z-index: 1;
}

.overview-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: .28rem .72rem;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.overview-eyebrow.dark {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #2563eb;
}

.overview-hero h1,
.ops-hero h1 {
  max-width: 880px;
  margin: .85rem 0;
  font-size: clamp(2.15rem, 4.8vw, 4.5rem);
  line-height: .98;
  font-weight: 950;
  letter-spacing: -.055em;
}

.ops-hero h1 {
  font-size: clamp(2rem, 4vw, 3.65rem);
}

.overview-hero p,
.ops-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 1.08rem;
}

.overview-actions,
.ops-hero-actions,
.ops-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1.4rem;
}

.ops-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: .35rem .75rem;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .88);
  font-size: .86rem;
  font-weight: 700;
}

.overview-hero-card {
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 24px;
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  overflow: hidden;
}

.hero-window-bar {
  display: flex;
  gap: .45rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.hero-window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
}

.hero-inbox-preview {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.hero-chat-list,
.hero-message-pane {
  display: grid;
  gap: .75rem;
}

.hero-chat {
  display: flex;
  gap: .7rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 16px;
  padding: .75rem;
  background: rgba(255, 255, 255, .1);
}

.hero-chat.active {
  background: rgba(255, 255, 255, .22);
}

.hero-chat strong,
.hero-chat small {
  display: block;
}

.hero-chat small {
  color: rgba(255, 255, 255, .72);
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.hero-dot.telegram {
  background: #38bdf8;
}

.hero-dot.zalo {
  background: #2563eb;
}

.hero-dot.viber {
  background: #8b5cf6;
}

.hero-bubble {
  max-width: 86%;
  border-radius: 18px;
  padding: .8rem .95rem;
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.hero-bubble.right {
  justify-self: end;
  background: rgba(255, 255, 255, .86);
  color: #172033;
}

.hero-status-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  border-radius: 16px;
  padding: .75rem;
  background: rgba(15, 23, 42, .24);
  color: rgba(255, 255, 255, .82);
  font-size: .82rem;
  font-weight: 750;
}

.overview-metrics,
.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 1rem;
}

.overview-metric,
.ops-kpi-card,
.ops-focus-card,
.overview-panel,
.ops-panel {
  border: 1px solid #dfe7f2;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.overview-metric {
  display: grid;
  gap: .55rem;
  padding: 1.1rem;
  border-radius: 22px;
  color: #172033;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.overview-metric:hover,
.ops-list-row:hover,
.ops-person-row:hover,
.ops-latest-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 24px 70px rgba(37, 99, 235, .14);
}

.metric-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #eff6ff;
  font-size: 1.35rem;
}

.overview-metric strong {
  font-size: 1.05rem;
}

.overview-metric small {
  color: #64748b;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 1rem;
}

.overview-panel,
.ops-panel {
  border-radius: 24px;
  overflow: hidden;
}

.overview-panel.large {
  min-height: 320px;
}

.overview-panel-title,
.ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem;
  border-bottom: 1px solid #edf2f7;
}

.overview-panel-title h2,
.ops-panel-head h2 {
  margin: .35rem 0 0;
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -.02em;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: .75rem;
  padding: 1.15rem;
}

.workflow-step {
  display: grid;
  gap: .55rem;
  min-height: 170px;
  border-radius: 20px;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border: 1px solid #e5edf7;
}

.workflow-step span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
}

.workflow-step small,
.next-list small {
  color: #64748b;
}

.workflow-line {
  display: none;
}

.next-list {
  display: grid;
  gap: .8rem;
  padding: 1.15rem;
}

.next-list div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .75rem;
  row-gap: .15rem;
  padding: .9rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e8eef6;
}

.next-list span {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 900;
}

.ops-focus-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(190px, 1fr));
  gap: 1rem;
}

.ops-focus-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: .8rem;
  min-height: 210px;
  padding: 1.2rem;
  border-radius: 26px;
}

.ops-focus-card.primary {
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(125, 211, 252, .58), transparent 32%),
    linear-gradient(135deg, #1d4ed8, #0f172a);
}

.ops-focus-card.warning {
  background: linear-gradient(135deg, #fff7ed, #fff);
}

.ops-focus-card.success {
  background: linear-gradient(135deg, #ecfdf5, #fff);
}

.ops-focus-card span,
.ops-kpi-card span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.ops-focus-card.primary span,
.ops-focus-card.primary small {
  color: rgba(255, 255, 255, .78);
}

.ops-focus-card strong,
.ops-kpi-card strong {
  font-size: 2.15rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.04em;
}

.ops-focus-card.primary strong {
  font-size: 3.2rem;
}

.ops-focus-card small,
.ops-kpi-card small {
  color: #64748b;
}

.ops-mini-chart {
  display: flex;
  align-items: end;
  gap: .45rem;
  height: 76px;
}

.ops-mini-chart i {
  flex: 1;
  border-radius: 999px 999px 6px 6px;
  background: rgba(255, 255, 255, .75);
}

.ops-ring {
  --value: 0;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#2563eb calc(var(--value) * 1%), #e5e7eb 0);
}

.ops-ring span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #172033;
  font-size: .95rem;
  letter-spacing: 0;
}

.ops-stack {
  display: grid;
  gap: .45rem;
}

.ops-stack span {
  width: fit-content;
  border-radius: 999px;
  padding: .28rem .65rem;
  background: rgba(248, 113, 113, .12);
  color: #991b1b;
  text-transform: none;
  letter-spacing: 0;
}

.ops-progress {
  height: 12px;
  border-radius: 999px;
  background: #d1fae5;
  overflow: hidden;
}

.ops-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.ops-kpi-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.ops-kpi-card {
  display: grid;
  gap: .5rem;
  min-height: 136px;
  padding: 1rem;
  border-radius: 22px;
  border-top: 4px solid #e2e8f0;
}

.modern-inbox-page .ops-kpi-card {
  min-height: 78px;
  gap: .25rem;
  padding: .7rem .85rem;
  border-radius: 16px;
}

.modern-inbox-page .ops-kpi-card span {
  font-size: .72rem;
}

.modern-inbox-page .ops-kpi-card strong {
  font-size: 1.35rem;
}

.modern-inbox-page .ops-kpi-card small {
  font-size: .72rem;
}

.ops-kpi-card.blue { border-top-color: #2563eb; }
.ops-kpi-card.indigo { border-top-color: #4f46e5; }
.ops-kpi-card.green { border-top-color: #16a34a; }
.ops-kpi-card.cyan { border-top-color: #0891b2; }
.ops-kpi-card.amber { border-top-color: #f59e0b; }
.ops-kpi-card.red { border-top-color: #ef4444; }
.ops-kpi-card.rose { border-top-color: #e11d48; }
.ops-kpi-card.slate { border-top-color: #475569; }
.ops-kpi-card.violet { border-top-color: #7c3aed; }
.ops-kpi-card.teal { border-top-color: #0d9488; }

.ops-main-grid,
.ops-secondary-grid,
.ops-table-grid {
  display: grid;
  gap: 1rem;
}

.ops-main-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr) minmax(320px, .8fr);
}

.ops-secondary-grid,
.ops-table-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.ops-panel.xl {
  min-height: 420px;
}

.ops-panel-head a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}

.ops-list {
  display: grid;
}

.ops-list.compact {
  gap: .15rem;
  padding: .55rem;
}

.ops-list-row,
.ops-person-row,
.ops-latest-card {
  color: #172033;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.ops-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .95rem 1.15rem;
  border-bottom: 1px solid #eef2f7;
}

.ops-list-row:hover,
.ops-person-row:hover {
  background: #f8fbff;
}

.ops-list-row strong,
.ops-person-row strong {
  display: block;
}

.ops-list-row small,
.ops-person-row small,
.ops-latest-card small,
.ops-latest-card em {
  display: block;
  color: #64748b;
  font-style: normal;
}

.ops-row-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 950;
}

.ops-row-icon.danger {
  background: #fff1f2;
  color: #e11d48;
}

.ops-row-icon.warning {
  background: #fffbeb;
  color: #d97706;
}

.ops-row-icon.info {
  background: #ecfeff;
  color: #0891b2;
}

.ops-empty {
  padding: 1.2rem;
  color: #64748b;
}

.ops-status-list {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
}

.ops-status-item {
  display: grid;
  gap: .55rem;
}

.ops-status-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.ops-status-item span {
  color: #64748b;
}

.ops-status-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.ops-status-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.ops-person-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  border-radius: 18px;
  padding: .75rem;
}

.ops-person-row > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 950;
  text-transform: uppercase;
}

.ops-person-row em {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff7ed;
  color: #c2410c;
  font-style: normal;
  font-weight: 950;
}

.ops-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: .85rem;
  padding: 1.15rem;
}

.ops-channel-card {
  display: grid;
  gap: 1rem;
  min-height: 150px;
  border: 1px solid #e5edf7;
  border-radius: 20px;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.ops-channel-card strong {
  display: block;
  margin-top: .75rem;
  font-size: 2rem;
  font-weight: 950;
}

.ops-channel-card small,
.ops-channel-card span {
  color: #64748b;
}

.ops-channel-card > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.ops-channel-card > div:last-child span {
  border-radius: 999px;
  padding: .22rem .55rem;
  background: #f1f5f9;
  font-size: .82rem;
  font-weight: 750;
}

.ops-table-wrap {
  overflow: auto;
}

.ops-table thead th {
  color: #64748b;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ops-table td,
.ops-table th {
  padding: .9rem 1rem;
}

.ops-latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: .9rem;
  padding: 1.15rem;
}

.ops-latest-card {
  display: grid;
  gap: .75rem;
  min-height: 180px;
  border: 1px solid #e5edf7;
  border-radius: 20px;
  padding: 1rem;
  background: #fff;
}

.ops-latest-card > div {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}

.ops-latest-card strong {
  font-size: 1.05rem;
}

.report-page {
  display: grid;
  gap: 1.25rem;
}

.report-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1.25rem;
  align-items: end;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 15%, rgba(34, 211, 238, .42), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(251, 191, 36, .36), transparent 24%),
    linear-gradient(135deg, #111827, #312e81 52%, #0f766e);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.report-hero h1 {
  margin: .85rem 0;
  font-size: clamp(2.05rem, 4vw, 3.7rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.055em;
}

.report-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 1.04rem;
}

.report-range-form {
  display: grid;
  gap: .45rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(16px);
}

.report-range-form label {
  color: rgba(255, 255, 255, .82);
  font-size: .82rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(190px, 1fr));
  gap: 1rem;
}

.report-table {
  min-width: 1180px;
}

.report-score {
  display: grid;
  gap: .35rem;
  min-width: 130px;
}

.report-score strong {
  font-size: 1.05rem;
  font-weight: 950;
}

.report-score span {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.report-score i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

/* Modern customer inbox */
.modern-inbox-page {
  display: grid;
  gap: 1rem;
}

.inbox-flash {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .12);
}

.inbox-command-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 16% 18%, rgba(56, 189, 248, .5), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(168, 85, 247, .38), transparent 26%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 52%, #6d28d9 100%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.modern-inbox-page .inbox-command-hero {
  padding: 1rem 1.25rem;
  border-radius: 22px;
}

.inbox-command-hero h1 {
  margin: .75rem 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.055em;
}

.modern-inbox-page .inbox-command-hero h1 {
  margin: .35rem 0 .25rem;
  font-size: clamp(1.45rem, 2.6vw, 2.35rem);
}

.inbox-command-hero p {
  max-width: 860px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.modern-inbox-page .inbox-command-hero p {
  font-size: .95rem;
}

.modern-inbox-page .ops-hero-meta {
  gap: .45rem;
  margin-top: .55rem;
}

.modern-inbox-page .ops-hero-meta span {
  min-height: 28px;
  padding: .25rem .6rem;
  font-size: .82rem;
}

.inbox-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.inbox-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 1rem;
}

.compact-inbox-toolbar {
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  align-items: stretch;
}

.compact-inbox-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  min-width: max-content;
}

.compact-inbox-actions form {
  margin: 0;
}

.modern-inbox-shell {
  min-height: calc(100vh - 245px);
  height: calc(100vh - 245px);
  gap: 1rem;
}

.modern-inbox-list,
.modern-message-pane,
.modern-profile-pane {
  border: 1px solid #dfe7f2;
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .08);
}

.modern-inbox-list {
  display: flex;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.modern-panel-header {
  flex: 0 0 auto;
  padding: .75rem 1rem .65rem;
  border-bottom: 1px solid #edf2f7;
}

.modern-panel-header h2 {
  margin: .2rem 0 .05rem;
  font-size: 1.2rem;
  font-weight: 900;
}

.modern-panel-header p {
  margin: 0;
  color: #64748b;
  font-size: .86rem;
}

.modern-channel-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  padding: .7rem .75rem;
  border-bottom: 1px solid #edf2f7;
}

.modern-channel-card {
  display: grid;
  gap: .25rem;
  min-height: 74px;
  border: 1px solid #e5edf7;
  border-radius: 16px;
  padding: .6rem;
  color: #172033;
  text-decoration: none;
  background: linear-gradient(180deg, #f8fbff, #fff);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.modern-channel-card:hover,
.modern-channel-card.active {
  transform: translateY(-2px);
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .14);
}

.modern-channel-card strong {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 950;
}

.channel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
}

.channel-dot.zalo { background: #2563eb; }
.channel-dot.viber { background: #7c3aed; }
.channel-dot.telegram { background: #0ea5e9; }

.modern-inbox-search {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .45rem;
  padding: .65rem .75rem;
  border-bottom: 1px solid #edf2f7;
}

.assignment-quick-filters {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid #edf2f7;
}

.page-filter-shortcuts {
  padding: 0;
  margin: -.4rem 0 1rem;
  border-bottom: 0;
}

.assignment-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 28px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: .25rem .62rem;
  background: #fff;
  color: #2563eb;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  transition: .18s ease;
}

.assignment-chip:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.assignment-chip.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

.my-work-page {
  display: grid;
  gap: 1.25rem;
}

.work-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 24px;
  padding: 1.4rem;
  color: #fff;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, .24), transparent 34%), linear-gradient(135deg, #0f172a, #2563eb 54%, #7c3aed);
  box-shadow: 0 22px 48px rgba(37, 99, 235, .18);
}

.work-hero h1 {
  margin: .35rem 0 .25rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 950;
}

.work-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, .84);
}

.work-hero-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.work-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 1rem;
}

.work-kpi-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: .3rem;
  min-height: 132px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 1.1rem;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.work-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: #64748b;
}

.work-kpi-card.blue::before { background: #2563eb; }
.work-kpi-card.amber::before { background: #f59e0b; }
.work-kpi-card.rose::before { background: #e11d48; }

.work-kpi-card span,
.work-kpi-card small {
  color: #64748b;
  font-weight: 800;
}

.work-kpi-card strong {
  font-size: 2.35rem;
  line-height: 1;
  font-weight: 950;
}

.work-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.work-panel {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.work-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #edf2f7;
}

.work-panel-header h2 {
  margin: .2rem 0 0;
  font-size: 1.15rem;
  font-weight: 950;
}

.work-panel-header a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}

.work-list {
  display: grid;
  max-height: 430px;
  overflow: auto;
}

.work-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  text-decoration: none;
  transition: .16s ease;
}

.work-row:hover {
  background: #f8fbff;
}

.work-avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 950;
}

.work-avatar.task { background: linear-gradient(135deg, #16a34a, #22c55e); }
.work-avatar.ticket { background: linear-gradient(135deg, #e11d48, #f97316); }
.work-avatar.customer { background: linear-gradient(135deg, #0ea5e9, #2563eb); }

.work-row-main {
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.work-row-main strong,
.work-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-row-main small {
  color: #64748b;
}

.work-tag,
.work-score {
  display: inline-flex;
  min-width: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .3rem .65rem;
  background: #eff6ff;
  color: #2563eb;
  font-size: .78rem;
  font-weight: 900;
}

.work-tag.danger,
.work-tag.urgent {
  background: #fff1f2;
  color: #be123c;
}

.work-tag.high {
  background: #fffbeb;
  color: #b45309;
}

.work-tag.info,
.work-tag.normal {
  background: #eff6ff;
  color: #2563eb;
}

.work-empty {
  padding: 1.25rem;
  color: #64748b;
  font-weight: 700;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap span {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  z-index: 1;
}

.search-input-wrap input {
  padding-left: 2rem;
}

.modern-section-title {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
  padding: .55rem .85rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.modern-empty-state {
  display: grid;
  gap: .35rem;
  flex: 0 0 auto;
  padding: .8rem;
  color: #64748b;
}

.modern-empty-state strong {
  color: #172033;
}

.modern-conversation-list {
  display: grid;
  align-content: start;
  gap: .55rem;
  padding: 0 .75rem 1rem;
  flex: 1 1 auto;
  min-height: 330px;
  max-height: none;
  overflow: auto;
}

.modern-conversation-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: .85rem;
  border: 1px solid transparent;
  border-radius: 20px;
  min-height: 76px;
  padding: .72rem;
  background: #fff;
  color: #172033;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.modern-conversation-card:hover,
.modern-conversation-card.active {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  background: #eff6ff;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .12);
}

.modern-avatar {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 950;
  text-transform: uppercase;
}

.modern-message-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.modern-message-header {
  border-bottom: 1px solid #edf2f7;
  background: rgba(255, 255, 255, .96);
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.small-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
}

.modern-status-form {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.modern-info-reminder {
  border: 0;
  border-bottom: 1px solid #fde68a;
  background: linear-gradient(90deg, #fffbeb, #fff7ed);
}

.modern-message-list {
  padding: 1.25rem;
  max-height: none;
  overflow: auto;
  background:
    radial-gradient(circle at 18px 18px, rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(180deg, #f8fbff, #ffffff);
  background-size: 26px 26px, auto;
}

.modern-message-bubble {
  max-width: min(72%, 640px);
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: .85rem 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.message-row.incoming .modern-message-bubble {
  border-bottom-left-radius: 8px;
  background: #fff;
}

.message-row.outgoing .modern-message-bubble {
  border-color: #bfdbfe;
  border-bottom-right-radius: 8px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.modern-message-bubble .message-sender {
  color: #2563eb;
  font-weight: 850;
  margin-bottom: .35rem;
}

.modern-message-bubble .message-time {
  margin-top: .45rem;
  color: #64748b;
  font-size: .76rem;
}

.modern-reply-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: end;
  padding: 1rem;
  border-top: 1px solid #edf2f7;
  background: #fff;
}

.reply-main {
  min-width: 0;
}

.modern-quick-replies {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding-bottom: .45rem;
}

.send-button {
  min-width: 76px;
  min-height: 44px;
  border-radius: 14px;
  font-weight: 850;
}

.modern-chat-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .65rem;
  min-height: 360px;
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.modern-chat-empty h2 {
  margin: 0;
  color: #172033;
  font-weight: 900;
}

.empty-chat-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #eff6ff;
  font-size: 2rem;
}

.modern-profile-pane {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.modern-profile-header {
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 1rem;
}

.profile-score-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.profile-score-card > div {
  border: 1px solid #e5edf7;
  border-radius: 18px;
  padding: .8rem;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.profile-score-card span {
  display: block;
  color: #64748b;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-score-card strong {
  display: block;
  margin-top: .25rem;
  font-size: 1.1rem;
  font-weight: 950;
}

.modern-profile-info {
  display: grid;
  gap: .65rem;
}

.modern-profile-info div {
  border: 1px solid #e5edf7;
  border-radius: 16px;
  padding: .7rem;
  background: #f8fafc;
}

.compact-click-profile {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-click-profile button {
  display: grid;
  gap: .25rem;
  width: 100%;
  min-height: 74px;
  border: 1px solid #e5edf7;
  border-radius: 16px;
  padding: .7rem;
  background: #f8fafc;
  color: #172033;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.compact-click-profile button:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 14px 32px rgba(37, 99, 235, .12);
}

.compact-click-profile button span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.compact-click-profile button strong {
  font-size: .92rem;
  line-height: 1.25;
}

.autofill-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff, #fff);
}

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

.autofill-card span {
  color: #64748b;
  font-size: .82rem;
}

.profile-edit-details {
  border: 1px solid #e5edf7;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.profile-edit-details summary {
  display: grid;
  gap: .2rem;
  padding: .9rem 1rem;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.profile-edit-details summary::-webkit-details-marker {
  display: none;
}

.profile-edit-details summary span {
  color: #172033;
  font-weight: 900;
}

.profile-edit-details summary small {
  color: #64748b;
}

.profile-edit-details[open] summary {
  border-bottom: 1px solid #e5edf7;
}

.modern-quick-form {
  border: 1px solid #e5edf7;
  border-radius: 20px;
  background: #fff;
}

.profile-work-grid {
  display: grid;
  gap: 1rem;
}

.manual-profile-entry {
  display: grid;
  gap: .35rem;
  margin-top: .65rem;
}

.manual-profile-entry small {
  color: #64748b;
  font-size: .76rem;
  line-height: 1.25;
}

.inline-profile-form {
  display: grid;
  gap: .45rem;
  margin-top: .65rem;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: .65rem;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.inline-profile-form-title {
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.inline-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}

@media (min-width: 1301px) {
  .app-content:has(.modern-inbox-page) {
    overflow: hidden;
    padding: .75rem;
  }

  .modern-inbox-page {
    height: calc(100vh - 1.5rem);
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: .55rem;
  }

  .inbox-command-hero {
    align-items: center;
    padding: .45rem .7rem;
    border-radius: 16px;
  }

  .inbox-command-hero h1 {
    margin: .08rem 0;
    font-size: clamp(1.08rem, 1.45vw, 1.55rem);
    letter-spacing: -.045em;
  }

  .inbox-command-hero p {
    max-width: 760px;
    font-size: .78rem;
    line-height: 1.25;
  }

  .inbox-command-hero .ops-hero-meta {
    margin-top: .28rem;
    gap: .25rem;
  }

  .inbox-command-hero .ops-hero-meta span {
    padding: .2rem .45rem;
    font-size: .7rem;
  }

  .inbox-hero-actions {
    gap: .35rem;
  }

  .inbox-hero-actions .btn {
    padding: .45rem .7rem;
    border-radius: 12px;
    font-size: .86rem;
  }

  .inbox-insight-grid {
    gap: .45rem;
  }

  .compact-inbox-toolbar {
    grid-template-columns: repeat(4, minmax(95px, 1fr)) auto;
  }

  .compact-inbox-actions .btn {
    min-height: 32px;
    padding: .32rem .55rem;
    border-radius: 11px;
    font-size: .78rem;
  }

  .inbox-insight-grid .ops-kpi-card {
    min-height: 42px;
    padding: .38rem .55rem;
    border-radius: 14px;
  }

  .inbox-insight-grid .ops-kpi-card strong {
    font-size: .98rem;
  }

  .inbox-insight-grid .ops-kpi-card small {
    font-size: .62rem;
  }

  .inbox-insight-grid .ops-kpi-card span {
    font-size: .66rem;
    letter-spacing: .04em;
  }

  .modern-inbox-shell {
    grid-template-columns: clamp(220px, 17vw, 280px) minmax(620px, 1.55fr) clamp(235px, 18vw, 295px);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    gap: .75rem;
  }

  .modern-inbox-list,
  .modern-message-pane,
  .modern-profile-pane {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  .modern-inbox-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .modern-panel-header {
    padding: .45rem .6rem .35rem;
  }

  .modern-panel-header h2 {
    margin: .08rem 0 0;
    font-size: .98rem;
  }

  .modern-panel-header p {
    display: none;
  }

  .modern-channel-grid {
    gap: .45rem;
    padding: .45rem .5rem;
  }

  .modern-channel-card {
    min-height: 48px;
    padding: .38rem .42rem;
    border-radius: 13px;
  }

  .modern-channel-card strong {
    font-size: .9rem;
  }

  .modern-inbox-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    padding: .45rem .5rem;
  }

  .modern-inbox-search .search-input-wrap,
  .modern-inbox-search button {
    grid-column: 1 / -1;
  }

  .assignment-quick-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .25rem;
    padding: .35rem .5rem;
  }

  .assignment-chip {
    min-height: 24px;
    padding: .16rem .28rem;
    font-size: .68rem;
    white-space: nowrap;
  }

  .modern-section-title {
    padding: .35rem .55rem;
    font-size: .68rem;
  }

  .modern-conversation-list {
    min-height: 360px;
    max-height: none;
    overflow: auto;
    padding: 0 .5rem .55rem;
  }

  .modern-conversation-card {
    gap: .65rem;
    min-height: 72px;
    padding: .62rem;
    border-radius: 16px;
  }

  .modern-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .modern-message-header {
    padding: .62rem .85rem;
  }

  .modern-info-reminder {
    padding: .45rem .85rem;
  }

  .modern-info-reminder h3,
  .modern-info-reminder p {
    margin-bottom: .1rem;
    font-size: .92rem;
  }

  .modern-info-reminder .btn {
    padding: .38rem .65rem;
    border-radius: 11px;
    font-size: .82rem;
  }

  .modern-message-pane {
    min-height: 0;
  }

  .modern-message-list {
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: .9rem 1rem;
  }

  .modern-message-bubble {
    max-width: min(78%, 760px);
  }

  .modern-reply-box {
    flex-shrink: 0;
    padding: .55rem .75rem;
    gap: .55rem;
  }

  .modern-quick-replies {
    gap: .3rem;
    padding-bottom: .25rem;
  }

  .modern-quick-replies .btn {
    padding: .32rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
  }

  .modern-reply-box textarea.form-control {
    min-height: 48px;
    max-height: 84px;
    resize: none;
  }

  .modern-reply-box .reply-hint {
    margin-top: .2rem;
    font-size: .72rem;
  }

  .modern-reply-box .send-button {
    min-height: 54px;
    min-width: 72px;
    border-radius: 16px;
  }

  .modern-profile-pane {
    align-content: start;
    overflow: auto;
    gap: .75rem;
    padding: .75rem;
  }

  .modern-profile-header {
    padding-bottom: .75rem;
  }

  .profile-score-card {
    gap: .4rem;
  }

  .profile-score-card > div {
    padding: .55rem;
    border-radius: 14px;
  }

  .profile-edit-details summary {
    padding: .7rem .8rem;
  }

  .modern-inbox-list {
    border-radius: 20px;
  }

  .modern-channel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: .45rem .55rem;
  }

  .modern-channel-card {
    min-height: 48px;
    gap: .18rem;
    padding: .4rem .45rem;
    border-radius: 14px;
  }

  .modern-channel-card strong {
    font-size: .92rem;
  }

  .modern-channel-card .channel-dot {
    width: 9px;
    height: 9px;
  }

  .modern-channel-card .badge,
  .modern-channel-card span:not(.channel-dot) {
    font-size: .72rem;
  }

  .modern-inbox-search {
    padding: .45rem .55rem;
  }

  .modern-inbox-search .form-control,
  .modern-inbox-search .form-select,
  .modern-inbox-search .btn {
    min-height: 36px;
    padding-top: .35rem;
    padding-bottom: .35rem;
    font-size: .84rem;
  }

  .modern-message-header .chat-title-row {
    gap: .55rem;
  }

  .modern-message-header .small-avatar {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .modern-message-header h2 {
    margin-bottom: .05rem;
    font-size: 1.16rem;
  }

  .modern-message-header p {
    margin-bottom: 0;
    font-size: .84rem;
  }

  .modern-status-form .form-select,
  .modern-status-form .btn {
    min-height: 36px;
    padding-top: .35rem;
    padding-bottom: .35rem;
    font-size: .84rem;
  }

  .modern-info-reminder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
  }

  .modern-info-reminder h3 {
    font-size: .95rem;
    line-height: 1.1;
  }

  .modern-info-reminder p {
    font-size: .78rem;
    line-height: 1.15;
  }

  .modern-profile-pane {
    border-radius: 20px;
  }

  .modern-profile-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .55rem;
    align-items: center;
  }

  .modern-profile-header .modern-avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .modern-profile-header h2 {
    margin-bottom: .1rem;
    font-size: 1.12rem;
  }

  .modern-profile-header .d-flex {
    gap: .25rem !important;
  }

  .modern-profile-header .badge {
    padding: .28rem .48rem;
    font-size: .72rem;
  }

  .profile-score-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .32rem;
  }

  .profile-score-card > div {
    min-height: 62px;
    padding: .45rem;
  }

  .profile-score-card span {
    font-size: .62rem;
    line-height: 1.1;
  }

  .profile-score-card strong {
    font-size: 1rem;
  }

  .modern-profile-pane h3,
  .modern-profile-pane h4 {
    margin-bottom: .45rem;
    font-size: .86rem;
    letter-spacing: .06em;
  }

  .info-badges {
    gap: .3rem;
  }

  .info-badges .badge {
    padding: .28rem .45rem;
    font-size: .72rem;
  }

  .manual-profile-entry {
    grid-template-columns: 1fr;
    gap: .25rem;
    margin-top: .45rem;
  }

  .manual-profile-entry .btn {
    min-height: 34px;
    padding: .35rem .55rem;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 800;
  }

  .manual-profile-entry small {
    font-size: .68rem;
  }

  .inline-profile-form {
    gap: .34rem;
    margin-top: .45rem;
    padding: .5rem;
    border-radius: 14px;
  }

  .inline-profile-form-title {
    font-size: .68rem;
  }

  .inline-profile-form .form-control,
  .inline-profile-form .form-select {
    min-height: 32px;
    padding-top: .28rem;
    padding-bottom: .28rem;
    font-size: .78rem;
  }

  .inline-profile-form textarea.form-control {
    min-height: 42px;
    resize: none;
  }

  .inline-profile-form .btn {
    min-height: 32px;
    padding: .3rem .55rem;
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 850;
  }

  .modern-message-pane {
    display: grid;
    grid-template-rows: auto auto minmax(220px, 1fr) auto;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .modern-message-list {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .modern-reply-box {
    position: relative;
    z-index: 5;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -10px 26px rgba(15, 23, 42, .07);
  }

  .modern-reply-box textarea.form-control {
    height: 48px;
  }

  .modern-profile-pane {
    overscroll-behavior: contain;
  }

  .modern-profile-pane .profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
  }

  .modern-profile-pane .profile-actions .btn {
    flex: 1 1 120px;
    min-height: 32px;
    padding: .32rem .5rem;
    border-radius: 11px;
    font-size: .76rem;
    font-weight: 800;
  }

  .modern-profile-pane .profile-edit-details {
    display: none;
  }

  .profile-summary-grid {
    gap: .45rem;
  }

  .profile-summary-card {
    padding: .55rem;
    border-radius: 14px;
  }

  .profile-summary-card span {
    font-size: .68rem;
  }

  .profile-summary-card strong {
    font-size: .86rem;
  }
}

@media (max-width: 1300px) {
  .overview-hero,
  .ops-hero,
  .work-hero,
  .report-hero,
  .report-summary-grid,
  .inbox-command-hero,
  .ops-focus-grid,
  .ops-main-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .ops-kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .work-kpi-grid,
  .work-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-channel-grid,
  .ops-latest-grid,
  .inbox-insight-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .inbox-shell-three {
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  }

  .customer-profile-pane {
    grid-column: 1 / -1;
  }

  .conversation-filter {
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 1fr));
  }
}

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

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dde6f2;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer {
    margin-top: 1rem;
  }

  .login-screen {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    align-content: center;
    padding: 1.25rem;
  }

  .login-hero {
    text-align: center;
  }

  .login-logo {
    margin: 0 auto;
  }

  .login-description {
    margin-left: auto;
    margin-right: auto;
  }

  .login-feature-list {
    justify-content: center;
  }

  .work-hero,
  .work-kpi-grid,
  .work-board {
    grid-template-columns: 1fr;
  }

  .work-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .work-hero-actions {
    justify-content: flex-start;
  }

  .conversation-filter {
    grid-template-columns: 1fr;
  }

  .conversation-table-scroll {
    min-height: 420px;
    max-height: 70vh;
  }

  .dashboard-grid,
  .dashboard-grid.ops-grid,
  .dashboard-grid.employee-summary-grid,
  .overview-metrics,
  .report-summary-grid,
  .inbox-insight-grid,
  .ops-kpi-grid,
  .ops-secondary-grid,
  .ops-table-grid,
  .ops-channel-grid,
  .ops-latest-grid,
  .dashboard-panels,
  .dashboard-panels.ops-panels,
  .dashboard-panels.ops-panels.wide,
  .dashboard-list.compact-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .inbox-shell {
    grid-template-columns: 1fr;
  }

  .conversation-list,
  .message-list {
    max-height: none;
  }

  .filter-bar,
  .filter-bar.wide,
  .customer-filter {
    grid-template-columns: 1fr;
  }

  .customer-metrics,
  .customer-detail-grid,
  .customer-360-grid,
  .customer-work-grid,
  .employee-detail-grid,
  .transfer-actions,
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-hero,
  .ops-hero,
  .inbox-command-hero {
    border-radius: 22px;
    padding: 1.2rem;
  }

  .overview-hero h1,
  .ops-hero h1,
  .inbox-command-hero h1 {
    font-size: 2.2rem;
  }

  .hero-inbox-preview {
    grid-template-columns: 1fr;
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .ops-list-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ops-list-row > .text-end {
    grid-column: 2;
    text-align: start !important;
  }

  .modern-channel-grid,
  .profile-score-card {
    grid-template-columns: 1fr;
  }

  .modern-reply-box {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }
}

@media (max-width: 1199.98px) {
  .app-brand {
    min-width: auto;
  }

  .app-menu {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    border-radius: 18px;
    margin-top: 1rem;
    width: 100%;
  }

  .app-header-status {
    width: 100%;
    margin: .75rem 0 0;
  }

  .logout-form {
    width: 100%;
    margin: .75rem 0 0;
    justify-content: space-between;
  }

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

@media (max-width: 575.98px) {
  .app-content {
    padding: 1rem;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .login-screen {
    width: 100%;
    min-height: auto;
    padding: 1rem;
  }

  .login-hero h1 {
    font-size: 2rem;
  }

  .login-description,
  .login-feature-list {
    display: none;
  }

  .login-card {
    border-radius: 22px;
  }

  .app-navbar {
    min-height: 64px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .app-menu {
    grid-template-columns: 1fr;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* CRM polish pass: keep current content, tighten spacing and make controls feel clickable. */
.sidebar-link.active {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  color: #0d6efd;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .12);
}

.sidebar-link.active .sidebar-icon {
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}

.btn {
  border-radius: 12px;
  font-weight: 800;
}

.btn-sm {
  border-radius: 10px;
}

.form-control,
.form-select {
  border-radius: 12px;
  border-color: #d9e2ef;
}

.form-control:hover,
.form-select:hover {
  border-color: #b8c7db;
}

.table-card,
.form-card,
.page-title,
.dashboard-card,
.report-card,
.work-panel {
  border-color: #dfe7f2;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .07);
}

.table-card .table {
  margin-bottom: 0;
}

.table-card .table thead th {
  color: #64748b;
  font-size: .78rem;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.filter-bar {
  align-items: end;
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}

.compact-inbox-toolbar {
  position: relative;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: .6rem;
  margin-bottom: -.1rem;
}

.compact-inbox-toolbar .ops-kpi-card {
  min-height: 64px;
  padding: .65rem .8rem;
  border-radius: 16px;
}

.compact-inbox-toolbar .ops-kpi-card strong {
  font-size: 1.2rem;
}

.compact-inbox-toolbar .ops-kpi-card small {
  font-size: .76rem;
}

.compact-inbox-actions {
  padding: .2rem;
}

.compact-inbox-actions .btn {
  min-height: 38px;
  padding-inline: .75rem;
}

.modern-inbox-shell {
  grid-template-columns: minmax(290px, .82fr) minmax(620px, 1.85fr) minmax(270px, .78fr);
}

.modern-inbox-list,
.modern-message-pane,
.modern-profile-pane {
  border-radius: 22px;
}

.modern-panel-header {
  padding: .55rem .85rem .45rem;
}

.modern-panel-header h2 {
  font-size: 1.05rem;
}

.modern-panel-header p {
  font-size: .78rem;
}

.modern-channel-grid {
  gap: .35rem;
  padding: .5rem .6rem;
}

.modern-channel-card {
  min-height: 54px;
  border-radius: 14px;
  padding: .45rem .5rem;
}

.modern-channel-card span:not(.channel-dot) {
  font-size: .82rem;
  font-weight: 800;
}

.modern-channel-card strong {
  font-size: 1rem;
}

.modern-inbox-search {
  gap: .35rem;
  padding: .5rem .6rem;
}

.modern-inbox-search .form-control,
.modern-inbox-search .form-select,
.modern-inbox-search .btn {
  min-height: 36px;
  font-size: .84rem;
}

.assignment-quick-filters {
  padding: .42rem .6rem;
}

.assignment-chip {
  min-height: 26px;
  padding: .18rem .48rem;
  font-size: .72rem;
}

.modern-section-title {
  padding: .38rem .65rem;
}

.modern-conversation-list {
  flex: 1 1 auto;
  min-height: 292px;
  padding: .35rem .55rem .65rem;
}

.modern-conversation-card {
  min-height: 66px;
  padding: .56rem;
  border-radius: 15px;
}

.modern-conversation-card .conversation-preview {
  margin-top: .1rem;
  font-size: .82rem;
}

.modern-conversation-card .conversation-meta {
  margin-top: .25rem;
  gap: .35rem;
  font-size: .72rem;
}

.modern-message-header {
  min-height: 70px;
  padding: .72rem .9rem;
}

.modern-info-reminder {
  padding: .55rem .9rem;
}

.modern-message-list {
  padding: .95rem 1.1rem;
}

.modern-reply-box {
  padding: .6rem .85rem;
}

.modern-reply-box textarea.form-control {
  min-height: 48px;
  max-height: 78px;
}

.modern-profile-pane {
  padding: .8rem;
}

.profile-score-card > div,
.profile-summary-card,
.inline-profile-form {
  box-shadow: none;
}

@media (min-width: 1301px) {
  .modern-inbox-page {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .modern-inbox-shell {
    grid-template-columns: clamp(292px, 19vw, 340px) minmax(660px, 1.9fr) clamp(260px, 17vw, 315px);
  }

  .compact-inbox-toolbar .ops-kpi-card {
    min-height: 50px;
    padding: .45rem .62rem;
  }

  .modern-panel-header {
    padding: .42rem .6rem .34rem;
  }

  .modern-channel-grid {
    padding: .4rem .5rem;
  }

  .modern-channel-card {
    min-height: 44px;
  }

  .modern-inbox-search {
    padding: .4rem .5rem;
  }

  .assignment-quick-filters {
    padding: .32rem .5rem;
  }

  .modern-conversation-list {
    min-height: 310px;
  }
}

/* Inbox detail polish pass: denser CRM workspace, without removing existing content. */
@media (min-width: 1200px) {
  .app-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .app-sidebar {
    padding: .85rem;
  }

  .sidebar-brand {
    padding: .5rem;
  }

  .sidebar-link {
    min-height: 42px;
    gap: .62rem;
    padding: .55rem .62rem;
    border-radius: 14px;
    font-size: .96rem;
  }

  .sidebar-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }
}

.app-content:has(.modern-inbox-page) {
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, .08), transparent 25%),
    linear-gradient(180deg, #f6f8fc, #eef3f9);
}

.modern-inbox-page {
  --crm-panel-radius: 20px;
}

.compact-inbox-toolbar {
  align-items: stretch;
}

.compact-inbox-toolbar .ops-kpi-card {
  display: grid;
  align-content: center;
  gap: .1rem;
  border-top-width: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .95));
}

.compact-inbox-toolbar .ops-kpi-card span {
  white-space: nowrap;
}

.compact-inbox-actions {
  align-self: stretch;
}

.compact-inbox-actions form,
.compact-inbox-actions .btn {
  height: 100%;
}

.compact-inbox-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.modern-inbox-shell {
  align-items: stretch;
}

.modern-inbox-list,
.modern-message-pane,
.modern-profile-pane {
  border-radius: var(--crm-panel-radius);
}

.modern-inbox-list {
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, .05), transparent 32%),
    #fff;
}

.modern-panel-header {
  display: grid;
  gap: .15rem;
}

.modern-channel-card,
.modern-conversation-card,
.profile-score-card > div,
.compact-click-profile button {
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.modern-channel-card:hover,
.modern-channel-card.active,
.modern-conversation-card:hover,
.modern-conversation-card.active {
  box-shadow: 0 14px 32px rgba(37, 99, 235, .12);
}

.modern-inbox-search {
  grid-template-columns: 1fr 1fr;
}

.modern-inbox-search .search-input-wrap,
.modern-inbox-search button {
  grid-column: 1 / -1;
}

.modern-inbox-search .search-input-wrap {
  border-radius: 14px;
}

.modern-inbox-search button {
  font-weight: 900;
}

.assignment-quick-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assignment-chip {
  width: 100%;
  white-space: nowrap;
}

.modern-section-title {
  color: #64748b;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.modern-conversation-list {
  scrollbar-gutter: stable;
}

.modern-conversation-card {
  border-left: 3px solid transparent;
}

.modern-conversation-card.active {
  border-left-color: #0d6efd;
}

.conversation-topline {
  gap: .35rem;
}

.platform-pill,
.status-pill {
  white-space: nowrap;
}

.modern-message-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}

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

.chat-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}

.quick-assign-form {
  display: grid;
  grid-template-columns: auto minmax(128px, 1fr) auto;
  gap: .4rem;
  align-items: center;
  min-width: min(340px, 42vw);
}

.quick-assign-label {
  margin: 0;
  color: #64748b;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.quick-assign-form .form-select,
.quick-assign-form .btn {
  height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.quick-assign-form .form-select {
  min-width: 0;
}

.quick-assign-form .btn {
  padding-inline: .8rem;
}

.modern-status-form {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) auto;
  gap: .4rem;
  align-items: center;
  min-width: min(260px, 34vw);
}

.modern-status-form .form-select {
  min-width: 0;
  height: 42px;
  border-radius: 14px;
  font-weight: 700;
}

.modern-status-form .status-save-button {
  width: 54px;
  height: 42px;
  padding-inline: .55rem;
  border-radius: 14px;
  font-weight: 900;
}

.modern-info-reminder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}

.modern-info-reminder .btn {
  white-space: nowrap;
}

.modern-message-list {
  min-height: 0;
  scrollbar-gutter: stable;
}

.modern-message-bubble {
  line-height: 1.45;
}

.modern-reply-box {
  grid-template-columns: minmax(0, 1fr) 74px;
}

.modern-quick-replies {
  scrollbar-width: thin;
}

.quick-reply-btn {
  white-space: nowrap;
}

.modern-reply-box .send-button {
  width: 74px;
  min-width: 74px;
}

.modern-profile-pane {
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, .05), transparent 28%),
    #fff;
  scrollbar-gutter: stable;
}

.modern-profile-header {
  gap: .65rem;
}

.modern-profile-header .profile-avatar {
  flex: 0 0 auto;
}

.profile-subline {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.profile-score-card {
  gap: .45rem;
}

.profile-score-card > div {
  min-width: 0;
  padding: .62rem;
}

.profile-score-card span {
  line-height: 1.1;
}

.profile-score-card strong {
  overflow-wrap: anywhere;
}

.customer-checklist.compact {
  gap: .35rem;
}

.customer-checklist.compact span {
  padding: .28rem .5rem;
  font-size: .78rem;
}

.manual-profile-entry {
  grid-template-columns: 1fr;
}

.inline-profile-form {
  overflow: hidden;
}

.inline-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-profile-form .form-control,
.inline-profile-form .form-select {
  min-width: 0;
}

.compact-click-profile {
  gap: .5rem;
}

.compact-click-profile button {
  min-height: 66px;
  padding: .62rem;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}

.profile-actions .btn {
  min-width: 0;
}

.autofill-card {
  grid-template-columns: 1fr;
}

.autofill-card .btn {
  width: 100%;
}

@media (min-width: 1301px) {
  .app-content:has(.modern-inbox-page) {
    padding: .7rem;
  }

  .modern-inbox-page {
    gap: .5rem;
  }

  .compact-inbox-toolbar {
    grid-template-columns: repeat(4, minmax(116px, 1fr)) minmax(180px, auto);
    gap: .5rem;
  }

  .compact-inbox-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .modern-inbox-shell {
    grid-template-columns: clamp(330px, 21vw, 370px) minmax(640px, 1fr) clamp(285px, 18vw, 330px);
    gap: .65rem;
  }

  .modern-message-header {
    min-height: 68px;
    padding: .58rem .75rem;
  }

  .modern-status-form {
    min-width: 212px;
  }

  .quick-assign-form {
    min-width: 260px;
    grid-template-columns: auto minmax(120px, 1fr) auto;
  }

  .modern-profile-pane {
    padding: .65rem;
    gap: .62rem;
  }

  .inline-profile-grid {
    grid-template-columns: 1fr;
  }

  .compact-click-profile {
    grid-template-columns: 1fr 1fr;
  }

  .compact-click-profile button {
    min-height: 58px;
  }
}

@media (max-width: 1500px) and (min-width: 1301px) {
  .modern-inbox-shell {
    grid-template-columns: clamp(305px, 22vw, 340px) minmax(560px, 1fr) clamp(255px, 18vw, 295px);
  }

  .modern-status-form {
    min-width: 190px;
    grid-template-columns: minmax(96px, 1fr) 50px;
  }

  .quick-assign-form {
    min-width: 230px;
    grid-template-columns: minmax(122px, 1fr) 48px;
  }

  .quick-assign-label {
    display: none;
  }

  .modern-status-form .status-save-button {
    width: 50px;
  }

  .profile-score-card span {
    font-size: .62rem;
  }
}

/* Fix Inbox layout when a postback message/alert is shown after saving status or syncing. */
.modern-inbox-page {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.modern-inbox-page .inbox-flash {
  margin: 0;
  min-height: 0;
  padding: .72rem 1rem;
  border-radius: 18px;
  line-height: 1.35;
}

.modern-inbox-page .inbox-live-notice.d-none {
  display: none !important;
}

.modern-inbox-page .inbox-live-notice {
  border: 0;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.modern-inbox-page:has(.inbox-flash) {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.modern-inbox-page:has(.inbox-flash) .modern-inbox-shell {
  height: auto;
  min-height: 0;
  max-height: none;
}

@media (min-width: 1301px) {
  .modern-inbox-page,
  .modern-inbox-page:has(.inbox-flash) {
    height: calc(100vh - 1.4rem);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .modern-inbox-page:has(.inbox-flash) .modern-inbox-shell {
    height: 100%;
    max-height: 100%;
  }

  .modern-inbox-page .inbox-flash {
    padding: .55rem .85rem;
    border-radius: 16px;
    font-size: .92rem;
  }
}

