:root {
  --bg: radial-gradient(120% 120% at 20% 20%, #dbeafe 0%, #eef2ff 40%, #f5f3ff 55%, #e0e7ff 80%);
  --bg-2: radial-gradient(90% 90% at 80% 10%, rgba(99, 102, 241, 0.35), transparent 55%);
  --panel: #ffffffcc;
  --panel-strong: #ffffff;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #a855f7;
  --warning: #f59e0b;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --chip: #e2e8f0;
  --radius: 14px;
  font-family: "Inter", "Manrope", system-ui, -apple-system, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg), var(--bg-2), linear-gradient(135deg, #e0f2fe 0%, #eef2ff 35%, #f5f3ff 70%, #e0e7ff 100%);
  min-height: 100vh;
  overflow: hidden;
  color: var(--text);
}
#root {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
#root::before,
#root::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  z-index: 0;
}
#root::before {
  background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.45), rgba(168, 85, 247, 0.25));
  top: -120px;
  left: -120px;
}
#root::after {
  background: radial-gradient(circle at 70% 60%, rgba(99, 102, 241, 0.45), rgba(59, 130, 246, 0.3));
  bottom: -160px;
  right: -100px;
}
.card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.9));
  border-radius: 18px;
  box-shadow: 0 20px 80px rgba(59, 130, 246, 0.18), 0 10px 40px rgba(76, 29, 149, 0.12);
  border: 1px solid rgba(219, 234, 254, 0.9);
}
.login-wrapper {
  width: 100%;
  display: grid;
  place-items: center;
  position: relative;
}
.role-wrapper {
  width: min(1200px, 96vw);
  margin: 0 auto;
  position: relative;
  padding: 24px 12px 48px;
}
.role-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  position: relative;
  z-index: 1;
}
.role-card {
  min-height: 150px;
  padding: 20px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  background: linear-gradient(150deg, rgba(255,255,255,0.9), rgba(233, 237, 255, 0.92));
}
.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
}
.role-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e0e7ff, #e9d5ff);
  font-size: 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.shape {
  position: absolute;
  opacity: 0.32;
  filter: blur(0.3px);
  animation: drift 26s linear infinite;
}
.shape.circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #60a5fa, #a78bfa);
}
.shape.square {
  width: 180px;
  height: 180px;
  border-radius: 24px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}
.shape.triangle {
  width: 0;
  height: 0;
  border-left: 110px solid transparent;
  border-right: 110px solid transparent;
  border-bottom: 190px solid rgba(59, 130, 246, 0.8);
  filter: drop-shadow(0 20px 40px rgba(76, 29, 149, 0.18));
}
.shape.triangle.alt {
  border-bottom-color: rgba(168, 85, 247, 0.85);
}
.shape:nth-child(1) {
  top: 6%;
  left: 12%;
  animation-duration: 32s;
  animation-delay: -4s;
}
.shape:nth-child(2) {
  top: 18%;
  right: 10%;
  animation-duration: 28s;
  animation-delay: -12s;
}
.shape:nth-child(3) {
  bottom: 14%;
  left: 18%;
  animation-duration: 30s;
  animation-delay: -7s;
}
.shape:nth-child(4) {
  bottom: 8%;
  right: 16%;
  animation-duration: 34s;
  animation-delay: -18s;
}
.shape:nth-child(5) {
  top: 42%;
  left: 48%;
  animation-duration: 36s;
  animation-delay: -22s;
}
.shape:nth-child(6) {
  top: 65%;
  right: 42%;
  animation-duration: 24s;
  animation-delay: -9s;
}
@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(20px, -30px, 0) rotate(8deg);
  }
  100% {
    transform: translate3d(-15px, 25px, 0) rotate(16deg);
  }
}
.login-card {
  width: min(420px, 90vw);
  padding: 32px;
  backdrop-filter: blur(8px);
  position: relative;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(168, 85, 247, 0.35));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, #e0f2fe, #ede9fe);
  color: #1e3a8a;
  font-weight: 600;
  margin-bottom: 16px;
}
.login-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.15);
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: #f8fafc;
}
.input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: #fff;
}
.input-group {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6366f1;
  opacity: 0.85;
  pointer-events: none;
}
.input.input-with-icon {
  padding-left: 40px;
}
.login-card form {
  display: grid;
  gap: 10px;
}
.input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.button {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #6366f1, #2563eb, #7c3aed);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.button:not(:disabled):hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.28);
}
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  width: min(1200px, 96vw);
  height: calc(100vh - 32px);
  min-height: 0;
}
.sidebar {
  padding: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 242, 255, 0.9));
  border-radius: 18px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  box-shadow: 0 18px 50px rgba(59, 130, 246, 0.14);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.messages-pane {
  overflow-y: auto;
  padding-right: 8px;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.message-row {
  display: flex;
}
.message-row.me {
  justify-content: flex-end;
}
.message-row.them {
  justify-content: flex-start;
}
.ticket-list {
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
  padding-right: 4px;
}
.ticket-card {
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  margin-bottom: 10px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(235, 242, 255, 0.95));
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
}
.ticket-card.active {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 18px 38px rgba(59, 130, 246, 0.18);
}
.ticket-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
}
.ticket-info {
  overflow: hidden;
}
.ticket-title {
  font-weight: 700;
  font-size: 15px;
}
.ticket-name {
  font-weight: 700;
  font-size: 15px;
  max-width: 180px;
}
.ticket-email,
.ticket-line,
.ticket-summary {
  color: var(--muted);
  font-size: 12px;
}
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-summary {
  margin-top: 4px;
}
.ticket-meta {
  color: var(--muted);
  font-size: 12px;
}
.ticket-card .ticket-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}
.chat-bubble {
  max-width: 75%;
  width: fit-content;
  padding: 12px 14px 10px;
  border-radius: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
  position: relative;
  display: inline-flex;
  flex-direction: column;
}
.chat-bubble.me {
  background: linear-gradient(140deg, #2563eb, #4f46e5, #7c3aed);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 12px 26px rgba(59, 130, 246, 0.25);
}
.chat-bubble.them {
  background: rgba(255, 255, 255, 0.82);
  color: #0f172a;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.bubble-meta {
  font-size: 11px;
  color: inherit;
  opacity: 0.85;
  margin-top: 6px;
  text-align: right;
}
.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
}
.tag.warning {
  background: #fef3c7;
  color: #92400e;
}
.tag.success {
  background: #dcfce7;
  color: #166534;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
}
.send-box {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 14px 32px rgba(59, 130, 246, 0.12);
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.title {
  font-weight: 700;
  font-size: 18px;
}
.alert {
  padding: 12px;
  border-radius: 12px;
  margin: 10px 0;
}
.alert.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecdd3;
}
.alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.chip {
  border: none;
  background: #e0e7ff;
  color: #312e81;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.chip-ghost {
  background: #f8fafc;
  color: #475569;
  border: 1px solid var(--border);
}
.chip-active {
  background: var(--primary);
  color: white;
}
.chip.ghost {
  background: #eef2ff;
  color: #1e3a8a;
}
.chip.strong {
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #fff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-dot.on {
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.18);
}
.status-dot.off {
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.18);
}
.filter-group {
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(240, 245, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 6px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(240,245,255,0.92));
  box-shadow: 0 8px 20px rgba(59,130,246,0.10);
  backdrop-filter: blur(8px);
}
.status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.filter-label {
  font-weight: 600;
  margin: 6px 0;
  color: #0f172a;
}
.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
}
.pill-ghost {
  background: #f1f5f9;
  color: #475569;
}
.header-cards {
  justify-content: space-between;
  gap: 12px;
  align-items: stretch;
}
.user-card,
.competition-card {
  flex: 1;
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
  min-height: 120px;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-right: 10px;
}
.user-card {
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: flex-start;
}
.competition-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  justify-content: center;
}
.chip-lite {
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: #e2e8f0;
  color: #0f172a;
}
.chip-lite.ghost {
  background: #f1f5f9;
  color: #475569;
}
.chip-lite.baru {
  background: #dcfce7;
  color: #166534;
}
.chip-lite.proses {
  background: #fef3c7;
  color: #92400e;
}
.chip-lite.selesai {
  background: #e0f2fe;
  color: #075985;
}
.status-radio {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-pill {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
  transition: transform 0.08s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}
.status-pill.blue { background: #e0e7ff; color: #1e3a8a; }
.status-pill.yellow { background: #fef3c7; color: #92400e; }
.status-pill.green { background: #dcfce7; color: #166534; }
.status-pill.active {
  transform: translateY(-1px);
  border: 1px solid rgba(0,0,0,0.06);
}
.status-pill.blue.active { background: #c7d2fe; color: #111827; box-shadow: 0 10px 24px rgba(59, 130, 246, 0.18); }
.status-pill.yellow.active { background: #fde68a; color: #78350f; box-shadow: 0 10px 24px rgba(245, 158, 11, 0.18); }
.status-pill.green.active { background: #bbf7d0; color: #065f46; box-shadow: 0 10px 24px rgba(34, 197, 94, 0.18); }
.meta-icon {
  font-size: 12px;
  color: #475569;
}
.row.tight {
  gap: 6px;
}
.messages-pane::-webkit-scrollbar,
.ticket-list::-webkit-scrollbar {
  width: 8px;
}
.messages-pane::-webkit-scrollbar-thumb,
.ticket-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.messages-pane::-webkit-scrollbar-track,
.ticket-list::-webkit-scrollbar-track {
  background: #f8fafc;
}
.date-divider {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}
.date-divider span {
  padding: 6px 10px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
}

/* Broadcast page */
.broadcast-layout {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
}
.broadcast-sidebar {
  overflow-y: auto;
  padding: 18px;
}
.broadcast-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.broadcast-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.2px;
}
.broadcast-subtitle {
  margin-top: 4px;
  max-width: 34ch;
}
.broadcast-header-actions {
  gap: 6px;
}
.broadcast-form-card {
  margin-top: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(242, 247, 255, 0.94));
}
.broadcast-form-card form {
  display: grid;
  gap: 10px;
}
.broadcast-inline-alert {
  margin: 2px 0 0;
}
.broadcast-form-actions {
  margin-top: 4px;
  justify-content: flex-end;
}
.broadcast-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.broadcast-toolbar {
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding-bottom: 10px;
}
.broadcast-cards {
  overflow-y: auto;
  padding-right: 6px;
  display: grid;
  gap: 12px;
}
.broadcast-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.broadcast-card-head {
  justify-content: space-between;
  align-items: flex-start;
}
.broadcast-head-copy {
  min-width: 0;
}
.broadcast-card-title {
  font-size: 17px;
  line-height: 1.25;
}
.broadcast-card-subtitle {
  margin-top: 2px;
  font-size: 12px;
}
.broadcast-status {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 700;
}
.broadcast-status.is-sent {
  background: #dcfce7;
  color: #166534;
}
.broadcast-status.is-sending {
  background: #dbeafe;
  color: #1d4ed8;
}
.broadcast-status.is-failed {
  background: #fee2e2;
  color: #b91c1c;
}
.broadcast-status.is-default {
  background: #e2e8f0;
  color: #334155;
}
.broadcast-card-body {
  margin: 0;
  line-height: 1.4;
}
.broadcast-progress-text {
  font-size: 12px;
  line-height: 1.35;
}
.broadcast-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.broadcast-progress-bar {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.broadcast-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  transition: width 0.25s ease;
}
.broadcast-progress-pct {
  font-size: 12px;
  color: #334155;
  font-weight: 700;
}
.broadcast-card-meta {
  gap: 8px;
  font-size: 12px;
  color: #52627a;
}
.broadcast-failed-detail {
  margin-top: 4px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  display: grid;
  gap: 8px;
}
.broadcast-failed-header {
  justify-content: space-between;
  margin-bottom: 0;
}
.broadcast-failed-title {
  font-weight: 700;
}
.broadcast-failed-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fbff;
}
.broadcast-failed-empty {
  padding: 10px;
}
.broadcast-failed-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  align-items: start;
}
.broadcast-failed-item:last-child {
  border-bottom: 0;
}
.broadcast-failed-copy {
  font-size: 12px;
  color: #334155;
  line-height: 1.35;
}
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 24px);
  }
  .content {
    min-height: auto;
  }
  .broadcast-layout {
    grid-template-columns: 1fr;
  }
  .broadcast-header {
    flex-direction: column;
    align-items: stretch;
  }
  .broadcast-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .broadcast-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .broadcast-card-meta {
    gap: 6px;
  }
}
