:root {
  --ink: #141c2b;
  --muted: #68748a;
  --line: #dfe6ef;
  --brand: #167567;
  --brand-dark: #0e4f49;
  --brand-soft: #e6f4f1;
  --accent: #f3b23f;
  --panel: #ffffff;
  --soft: #f3f6fa;
  --sidebar: #0f3440;
  --sidebar-dark: #0a2631;
  --shadow-sm: 0 10px 26px rgba(20, 28, 43, 0.08);
  --shadow-md: 0 22px 54px rgba(20, 28, 43, 0.12);
}

body {
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.96rem;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: 0;
}

.public-page {
  min-height: 100vh;
  background: #062242;
}

.hero-band {
  min-height: 100vh;
  background: linear-gradient(135deg, #06162a, #123f52);
}

.hero-band.has-company-bg,
.hero-band[style*="--company-bg"] {
  background:
    linear-gradient(90deg, rgba(6, 22, 42, 0.86) 0%, rgba(6, 34, 66, 0.72) 46%, rgba(6, 34, 66, 0.38) 100%),
    var(--company-bg) center/cover;
}

.hero-band .container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero-band .row {
  flex: 1;
}

.brand-mark {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
  font-size: 1.05rem;
}

.brand-mark.dark {
  color: var(--brand-dark);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  min-height: 72px;
}

.public-brand img {
  display: block;
  width: 220px;
  max-height: 86px;
  object-fit: contain;
  object-position: left center;
}

.public-brand span {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
}

.sidebar-logo {
  display: block;
  width: 170px;
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.eyebrow {
  color: #84e6dc;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.ticket-form-panel,
.login-panel,
.success-panel,
.content-panel,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.ticket-form-panel {
  border-radius: 8px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(0, 12, 30, 0.34);
  backdrop-filter: blur(8px);
}

.form-control,
.form-select,
.btn {
  border-radius: 8px;
}

.form-control,
.form-select {
  border-color: #d5dde8;
  min-height: 42px;
}

input,
select,
textarea {
  font-size: 16px;
}

textarea.form-control {
  min-height: 128px;
}

.form-label {
  color: #263347;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.btn {
  font-weight: 700;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(31, 122, 109, 0.16);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(22, 117, 103, 0.16);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-outline-primary {
  color: var(--brand-dark);
  border-color: #b7d8d2;
  background: #ffffff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.btn-dark {
  background: #1f2633;
  border-color: #1f2633;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.82);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  color: #062242;
  background: #ffffff;
  border-color: #ffffff;
}

.success-page,
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #eaf6f4, #f7f9fc);
}

.login-page {
  background: linear-gradient(135deg, #eaf6f4, #f7f9fc);
}

.login-page.has-company-bg,
.login-page[style*="--company-bg"] {
  background:
    linear-gradient(90deg, rgba(6, 22, 42, 0.78) 0%, rgba(6, 34, 66, 0.54) 52%, rgba(6, 34, 66, 0.18) 100%),
    var(--company-bg) center/cover;
}

.success-panel,
.login-panel {
  max-width: 520px;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.login-panel {
  max-width: 420px;
  text-align: left;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 28px 70px rgba(0, 12, 30, 0.34);
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--brand);
  font-size: 2rem;
  font-weight: 800;
}

.ticket-number {
  display: inline-flex;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  background: #edf7f5;
  color: var(--brand-dark);
  font-size: 1.45rem;
  font-weight: 800;
}

.settings-hint {
  border-left: 4px solid var(--accent);
  background: #fff8e7;
  color: #4b5563;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  background:
    linear-gradient(180deg, rgba(243, 246, 250, 0.96), rgba(237, 242, 248, 0.96)),
    radial-gradient(circle at 85% 0%, rgba(22, 117, 103, 0.08), transparent 34%);
}

.sidebar {
  width: 270px;
  background:
    linear-gradient(180deg, rgba(15, 52, 64, 0.98), rgba(10, 38, 49, 0.98)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%);
  color: #ffffff;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 44px rgba(9, 28, 36, 0.16);
}

.sidebar-brand {
  padding: 0.35rem 0.15rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand span {
  display: block;
  margin-top: 0.65rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-nav {
  gap: 0.35rem;
  margin-top: 1.35rem;
}

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

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 0.82rem 0.95rem;
  font-weight: 650;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
}

.sidebar .nav-link:hover {
  transform: translateX(2px);
}

.sidebar .nav-link.active {
  box-shadow: inset 3px 0 0 #6ee7d8;
}

.admin-content {
  flex: 1;
  padding: 2rem 2.2rem;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.35rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.page-kicker {
  display: block;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.page-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-content {
  background: linear-gradient(135deg, #eaf6f4, #f7f9fc);
}

.client-content[style*="--company-bg"] {
  background:
    linear-gradient(90deg, rgba(6, 22, 42, 0.88) 0%, rgba(6, 34, 66, 0.74) 48%, rgba(6, 34, 66, 0.42) 100%),
    var(--company-bg) center/cover fixed;
}

.metric-card {
  display: block;
  border-radius: 8px;
  padding: 1.1rem 1.15rem;
  min-height: 112px;
  position: relative;
  overflow: hidden;
  border-color: #e2e8f0;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: #c7d0dc;
}

.metric-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric-link:hover,
.metric-link:focus {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-link.active {
  outline: 2px solid rgba(22, 117, 103, 0.26);
  outline-offset: 3px;
  border-color: rgba(22, 117, 103, 0.36);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
}

.metric-card strong {
  display: block;
  font-size: 2.05rem;
  line-height: 1.1;
  margin-top: 0.35rem;
}

.metric-card.amber {
  border-left: 5px solid var(--accent);
}

.metric-card.amber::after {
  background: var(--accent);
}

.metric-card.blue {
  border-left: 5px solid #3378d8;
}

.metric-card.blue::after {
  background: #3378d8;
}

.metric-card.green {
  border-left: 5px solid var(--brand);
}

.metric-card.green::after {
  background: var(--brand);
}

.metric-card.red {
  border-left: 5px solid #dd3c4c;
}

.metric-card.red::after {
  background: #dd3c4c;
}

.client-dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 24px 62px rgba(0, 12, 30, 0.25);
  backdrop-filter: blur(8px);
}

.client-dashboard-hero h1 {
  margin: 0.25rem 0 0.35rem;
  font-size: 2rem;
}

.client-dashboard-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.client-kicker {
  display: block;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.dashboard-metrics {
  align-items: stretch;
}

.dashboard-metrics > [class*="col-"] {
  display: flex;
}

.dashboard-metrics .metric-card {
  width: 100%;
}

.client-metrics .metric-card {
  min-height: 104px;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 45px rgba(0, 12, 30, 0.22);
  backdrop-filter: blur(8px);
}

.client-ticket-panel {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 24px 60px rgba(0, 12, 30, 0.25);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.resolution-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98)),
    radial-gradient(circle at 92% 8%, rgba(22, 117, 103, 0.08), transparent 28%);
  overflow: hidden;
}

.executive-chart {
  padding: 0;
}

.resolution-header {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.35rem 1.5rem 1rem;
  border-bottom: 1px solid #e8eef5;
}

.resolution-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 0.75rem;
  min-width: min(520px, 100%);
}

.resolution-stat {
  border: 1px solid #dfe8f0;
  border-radius: 8px;
  padding: 0.82rem 0.95rem;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

.resolution-stat span,
.resolution-label span,
.resolution-time span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.resolution-stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
  line-height: 1.1;
}

.resolution-legend {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.9rem 1.5rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.resolution-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.resolved {
  background: var(--brand);
}

.legend-dot.open {
  background: var(--accent);
}

.resolution-chart {
  display: grid;
  gap: 0;
  padding: 0.4rem 1.5rem 1.35rem;
}

.resolution-row {
  display: grid;
  grid-template-columns: 132px minmax(180px, 1fr) 210px;
  gap: 1.1rem;
  align-items: center;
  padding: 0.95rem 0;
  border-top: 1px solid #edf1f6;
}

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

.resolution-label strong {
  display: block;
  font-size: 0.92rem;
}

.resolution-status {
  width: fit-content;
  margin-top: 0.3rem;
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-weight: 800;
}

.resolution-status.resolved {
  color: var(--brand-dark);
  background: #e4f5f1;
}

.resolution-status.open {
  color: #6f4a06;
  background: #fff3d4;
}

.resolution-visual {
  min-width: 0;
}

.resolution-track {
  height: 22px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(226, 233, 241, 0.8), rgba(238, 243, 248, 0.95)),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(148, 163, 184, 0.22) calc(25% - 1px), rgba(148, 163, 184, 0.22) 25%);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(16, 24, 40, 0.08);
}

.resolution-bar {
  position: relative;
  height: 100%;
  min-width: 34px;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.6rem;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.12);
}

.resolution-bar.resolved {
  background: linear-gradient(90deg, #1f8a78, var(--brand-dark));
}

.resolution-bar.open {
  background: linear-gradient(90deg, #f6c65a, #ee9f27);
  color: #3f2e0a;
}

.resolution-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  color: #8a96a8;
  font-size: 0.72rem;
  font-weight: 700;
}

.resolution-time {
  min-width: 0;
  border-left: 1px solid #e5ebf2;
  padding-left: 1rem;
}

.resolution-time strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.resolution-time span {
  overflow-wrap: anywhere;
  margin-top: 0.15rem;
}

.client-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 253, 0.9);
}

.client-toolbar h2 {
  margin: 0;
  font-size: 1.25rem;
}

.client-toolbar span {
  color: var(--muted);
  font-size: 0.92rem;
}

.client-filter {
  display: flex;
  gap: 0.6rem;
  min-width: min(420px, 100%);
}

.client-ticket-list {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.client-ticket-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.client-ticket-card:hover {
  border-color: #c9d7e5;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 12, 30, 0.08);
}

.ticket-card-main {
  min-width: 0;
}

.ticket-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.ticket-code {
  color: var(--brand-dark);
  background: #edf7f5;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-weight: 800;
  font-size: 0.86rem;
}

.client-ticket-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.client-ticket-card p {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}

.ticket-card-tags {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.unread-inline {
  color: #8f1f2c;
  background: #ffe3e8;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.ticket-card-side {
  border-left: 1px solid var(--line);
  padding-left: 1.25rem;
}

.ticket-card-side dl {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.ticket-card-side dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ticket-card-side dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
}

.empty-state p {
  color: var(--muted);
}

.content-panel {
  border-radius: 8px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.96);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ticket-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 0.65rem;
  align-items: end;
}

.ticket-filter-form > div {
  width: auto;
}

.table > :not(caption) > * > * {
  padding: 0.95rem 0.8rem;
}

.table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  color: #3b4658;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px solid #d7e0ea;
  white-space: nowrap;
}

.table tbody td {
  border-bottom-color: #e4eaf1;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background: #f8fbfd;
}

.status-pill,
.badge {
  border-radius: 999px;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
}

.status-pill {
  color: #184b43;
  background: #e2f4f0;
  border: 1px solid #ccebe4;
}

.status-pill.muted {
  color: #475467;
  background: #eef1f5;
}

.status-pill.large {
  font-size: 0.95rem;
}

.priority-baixa {
  color: #285b38;
  background: #e8f6ec;
  border: 1px solid #d2ead8;
}

.priority-media {
  color: #71520f;
  background: #fff4cf;
  border: 1px solid #f7df94;
}

.priority-alta {
  color: #8a3c12;
  background: #ffe8d7;
  border: 1px solid #f2c2a1;
}

.priority-urgente {
  color: #8f1f2c;
  background: #ffe3e8;
  border: 1px solid #f4c2cc;
}

.detail-list dt {
  color: var(--muted);
}

.preserve-lines {
  white-space: pre-wrap;
}

.settings-panel {
  max-width: 720px;
}

.maintenance-danger {
  border-color: #f0b8bf;
}

.maintenance-danger h2 {
  color: #8f1f2c;
}

.menu-badge,
.unread-badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dd3c4c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0 0.45rem;
}

.menu-badge {
  margin-left: auto;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-message {
  max-width: 220px;
}

.chat-panel {
  height: calc(100vh - 160px);
  min-height: 620px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.chat-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.chat-presence {
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-presence.online {
  color: var(--brand);
  font-weight: 700;
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  background:
    linear-gradient(rgba(246, 249, 252, 0.96), rgba(246, 249, 252, 0.96)),
    url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d9e4ea' fill-opacity='.45'%3E%3Ccircle cx='8' cy='8' r='2'/%3E%3Ccircle cx='48' cy='38' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

.chat-row {
  display: flex;
  margin-bottom: 0.85rem;
}

.chat-row.client {
  justify-content: flex-start;
}

.chat-row.support {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(78%, 560px);
  border-radius: 8px;
  padding: 0.72rem 0.85rem 0.5rem;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.chat-row.support .chat-bubble {
  background: #dff3ef;
  border-color: #bfe4dc;
}

.chat-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.chat-meta span {
  color: var(--muted);
  font-weight: 700;
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-time {
  margin-top: 0.3rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.76rem;
}

.chat-attachment {
  display: inline-flex;
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
}

.typing-indicator {
  min-height: 26px;
  padding: 0.25rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  background: #fff;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.chat-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18);
}

.chat-toast strong,
.chat-toast span,
.chat-toast a {
  display: block;
}

.chat-toast span {
  color: var(--muted);
  margin: 0.35rem 0 0.6rem;
  overflow-wrap: anywhere;
}

.chat-toast a {
  font-weight: 800;
  text-decoration: none;
}

.notification-enable {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1090;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18);
}

.notification-enable p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.notification-enable .btn {
  width: 100%;
}

.company-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.company-cell img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.company-preview {
  min-height: 92px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #f8fafc;
}

.company-preview img {
  max-width: 220px;
  max-height: 86px;
  object-fit: contain;
}

@media (max-width: 900px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 1rem;
    box-shadow: 0 12px 34px rgba(9, 28, 36, 0.16);
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
  }

  .sidebar-brand span {
    margin-top: 0;
    text-align: right;
  }

  .sidebar-logo {
    width: 126px;
    max-height: 58px;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row !important;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding-bottom: 0.35rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .nav-link {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.06);
  }

  .sidebar .nav-link:hover {
    transform: none;
  }

  .sidebar .nav-link.active {
    box-shadow: inset 0 -3px 0 #6ee7d8;
  }

  .sidebar-footer {
    padding-top: 0.75rem;
  }

  .sidebar-footer .btn {
    min-height: 38px;
  }

  .admin-content {
    padding: 1rem;
  }

  .page-header,
  .admin-dashboard-header {
    display: block;
    padding: 1.15rem;
  }

  .page-actions {
    justify-content: stretch;
    margin-top: 1rem;
  }

  .page-actions .btn {
    flex: 1 1 140px;
  }

  .ticket-form-panel {
    padding: 1.25rem;
  }

  .hero-band,
  .hero-band .container,
  .login-page {
    min-height: auto;
  }

  .hero-band .container {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .hero-band nav {
    margin-bottom: 1.5rem !important;
  }

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

  .hero-band .lead {
    font-size: 1rem;
  }

  .login-page {
    align-items: flex-start !important;
    padding: 1rem 0;
  }

  .login-panel,
  .success-panel {
    padding: 1.25rem;
  }

  .dashboard-metrics {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }

  .dashboard-metrics > [class*="col-"] {
    width: 50%;
  }

  .metric-card {
    min-height: 96px;
    padding: 0.95rem;
  }

  .metric-card span {
    font-size: 0.76rem;
  }

  .metric-card strong {
    font-size: 1.65rem;
  }

  .chat-panel {
    height: calc(100vh - 210px);
    min-height: 520px;
  }

  .chat-compose {
    grid-template-columns: 1fr auto;
    padding: 0.75rem;
  }

  .chat-compose .form-control {
    grid-column: 1 / -1;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .resolution-header,
  .resolution-row {
    display: block;
  }

  .resolution-header {
    padding: 1.1rem;
  }

  .resolution-stats {
    grid-template-columns: 1fr;
    min-width: 0;
    margin-top: 1rem;
  }

  .resolution-legend {
    justify-content: flex-start;
    padding: 0.85rem 1.1rem 0;
  }

  .resolution-chart {
    padding: 0.25rem 1.1rem 1.1rem;
  }

  .resolution-track,
  .resolution-time {
    margin-top: 0.75rem;
  }

  .resolution-time {
    border-left: 0;
    padding-left: 0;
  }

  .client-dashboard-hero,
  .client-toolbar,
  .client-filter,
  .panel-title-row {
    display: block;
  }

  .client-dashboard-hero .btn,
  .client-filter .btn,
  .client-filter .form-select,
  .ticket-filter-form .btn,
  .ticket-filter-form .form-select {
    width: 100%;
    margin-top: 0.75rem;
  }

  .ticket-filter-form {
    display: block;
    margin-top: 1rem;
  }

  .client-ticket-card {
    grid-template-columns: 1fr;
  }

  .ticket-card-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 1rem;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 0.94rem;
  }

  .admin-content {
    padding: 0.85rem;
  }

  .content-panel,
  .client-ticket-panel,
  .client-dashboard-hero {
    box-shadow: 0 14px 34px rgba(0, 12, 30, 0.12);
  }

  .content-panel {
    padding: 1rem;
  }

  .client-ticket-list {
    padding: 0.85rem;
  }

  .client-ticket-card {
    padding: 1rem;
  }

  .client-dashboard-hero h1 {
    font-size: 1.65rem;
  }

  .client-dashboard-hero .btn {
    min-height: 46px;
  }

  .dashboard-metrics > [class*="col-"] {
    width: 50%;
  }

  .metric-card {
    min-height: 90px;
  }

  .metric-card strong {
    font-size: 1.5rem;
  }

  .resolution-stat {
    min-width: 0;
  }

  .table-responsive {
    margin: 0 -0.25rem;
  }

  .table {
    min-width: 760px;
  }

  .chat-panel {
    height: calc(100vh - 190px);
    min-height: 460px;
  }

  .chat-header {
    padding: 0.9rem 1rem;
  }

  .chat-messages {
    padding: 0.85rem;
  }

  .chat-bubble {
    max-width: 96%;
  }

  .ticket-form-panel {
    padding: 1rem;
  }

  .ticket-form-panel .btn,
  .login-panel .btn,
  .success-panel .btn {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .dashboard-metrics > [class*="col-"] {
    width: 100%;
  }

  .metric-card {
    min-height: 82px;
  }

  .sidebar-brand {
    display: block;
  }

  .sidebar-brand span {
    margin-top: 0.55rem;
    text-align: left;
  }
}
