:root {
  --bg: #f5f6f8;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --panel-alt: #f1f3f7;
  --text: #0f1115;
  --muted: #6d7280;
  --line: #e8ebf0;
  --shadow: 0 20px 60px rgba(11, 16, 30, 0.08);
  --accent: #0f172a;
  --accent-soft: #e9eefc;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(64, 64, 64, 0.06), transparent 20%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
}

body {
  min-height: 100vh;
}

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

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

button {
  cursor: pointer;
}

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

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-size: 24px;
  font-weight: 800;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f172a, #111111 72%);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.search {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  outline: none;
}

.nav-group {
  margin-top: 28px;
}

.nav-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 16px;
  color: #20242c;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
  background: #0f1115;
  color: #fff;
  transform: translateX(3px);
}

.nav-pair {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef1f6;
  color: #303847;
  font-size: 12px;
  font-weight: 800;
}

.nav-link.active .badge {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(245, 246, 248, 0.84);
  backdrop-filter: blur(18px);
}

.toolbar,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn,
.ghost-btn,
.dark-btn,
.danger-btn,
.success-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-weight: 700;
}

.icon-btn {
  width: 48px;
  padding: 0;
  aspect-ratio: 1;
}

.dark-btn {
  border-color: #0f1115;
  background: #0f1115;
  color: #fff;
}

.success-btn {
  border-color: #15803d;
  background: #16a34a;
  color: #fff;
}

.danger-btn {
  border-color: #dc2626;
  background: #ef4444;
  color: #fff;
}

.page {
  padding: 4px 28px 28px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: 38px;
  line-height: 1;
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cols-main {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.8fr);
}

.cols-detail {
  grid-template-columns: minmax(0, 1.6fr) 320px;
}

.panel {
  border: 1px solid rgba(232, 235, 240, 0.92);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-pad {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-size: 24px;
}

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

.stat-card {
  min-height: 150px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 28px;
}

.stat-value {
  font-size: 40px;
  font-weight: 800;
}

.stat-foot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f5f8;
  font-size: 13px;
  font-weight: 700;
}

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--danger);
}

.chart {
  height: 320px;
  position: relative;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.02), transparent),
    repeating-linear-gradient(
      to top,
      rgba(15, 23, 42, 0.04),
      rgba(15, 23, 42, 0.04) 1px,
      transparent 1px,
      transparent 52px
    );
}

.chart svg {
  width: 100%;
  height: 100%;
}

.table-wrap {
  overflow: auto;
}

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

.data-table th,
.data-table td {
  padding: 18px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr {
  transition: background 0.16s ease;
}

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.03);
}

.subject {
  font-weight: 800;
}

.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.status,
.priority,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status-open,
.priority-high {
  background: #fff6d7;
  color: #855f00;
}

.status-progress {
  background: #e9f0ff;
  color: #224cb3;
}

.status-pending,
.priority-normal {
  background: #eef2f6;
  color: #475569;
}

.status-resolved {
  background: #dcfce7;
  color: #166534;
}

.priority-urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-low {
  background: #f3f4f6;
  color: #6b7280;
}

.tag {
  background: #f5f7fa;
  color: #334155;
  padding: 6px 10px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: #f7f8fb;
}

.person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 14px;
}

.avatar.soft {
  background: #e9eef8;
  color: #0f172a;
  box-shadow: none;
}

.chat-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 132px);
  overflow: hidden;
}

.chat-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(249, 250, 251, 0.85);
}

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

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.tab {
  padding: 10px 14px;
  border-radius: 14px;
  background: #eef1f6;
  color: #475569;
  font-weight: 800;
}

.tab.active {
  background: #0f1115;
  color: #fff;
}

.chat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 16px;
  background: #fff;
}

.chat-card.active {
  background: linear-gradient(180deg, #0f1115, #20232b);
  color: #fff;
}

.chat-card.active .muted,
.chat-card.active .meta {
  color: rgba(255, 255, 255, 0.74);
}

.thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.03), transparent 30%),
    #fbfbfc;
}

.bubble-row {
  display: flex;
  margin-bottom: 20px;
}

.bubble-row.agent {
  justify-content: flex-end;
}

.bubble {
  max-width: 640px;
  padding: 16px 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  white-space: pre-wrap;
}

.bubble-row.agent .bubble {
  background: #0f1115;
  color: #fff;
  border-color: #0f1115;
}

.composer {
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.composer textarea,
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
  outline: none;
}

.composer textarea {
  min-height: 96px;
  resize: vertical;
}

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

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

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

.field label {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.ticket-thread {
  padding: 22px;
}

.message-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.message-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 800;
}

.message-type {
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2f6;
  color: #475569;
  font-size: 12px;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: flex;
  gap: 14px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 7px;
  background: #0f1115;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.login-card {
  width: min(100%, 470px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.login-head {
  text-align: center;
  margin-bottom: 26px;
}

.login-head .brand-mark {
  margin: 0 auto 18px;
}

.login-head h1 {
  margin: 0;
  font-size: 40px;
}

.login-actions {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.helper-links {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .cards-4,
  .cols-main,
  .cols-detail,
  .form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .shell,
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .page,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cards-4,
  .cols-main,
  .cols-detail,
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}
