@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --cyan:      #06B6D4;
  --cyan-dim:  rgba(6,182,212,0.12);
  --cyan-bdr:  rgba(6,182,212,0.25);
  --navy:      #040D1A;
  --navy2:     #071428;
  --navy3:     #0A1F3D;
  --white:     #ffffff;
  --silver:    #CBD5E1;
  --muted:     #64748B;
  --danger:    #F43F5E;
  --success:   #10B981;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Circuit BG ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(6,182,212,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4,13,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cyan-bdr);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  height: 30px;
  width: auto;
  filter: brightness(1.1) drop-shadow(0 0 4px rgba(6,182,212,0.3));
}

.nav-product {
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.nav-link svg { flex-shrink: 0; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-number {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

.btn-logout {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  transition: all 0.15s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── MAIN WRAPPER ── */
.main {
  position: relative;
  z-index: 1;
  padding: 24px 20px;
  max-width: 960px;
  margin: 0 auto;
}

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 20px;
}
.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.3px;
}
.page-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(7,20,40,0.8);
  border: 1px solid var(--cyan-bdr);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-bdr);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.section-label::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--cyan);
  border-radius: 2px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--cyan-bdr), transparent);
}

/* ── CARD ── */
.card {
  background: rgba(7,20,40,0.8);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

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

thead th {
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(4,13,26,0.6);
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
  cursor: pointer;
}
tbody tr:hover { background: rgba(6,182,212,0.05); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--silver);
  vertical-align: middle;
}

.td-main { font-weight: 600; color: var(--white); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-cyan   { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-bdr); }
.badge-danger { background: rgba(244,63,94,0.12); color: var(--danger); border: 1px solid rgba(244,63,94,0.25); }
.badge-green  { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.badge-gray   { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid rgba(255,255,255,0.1); }

/* ── DOT ── */
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot-red    { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }
.dot-cyan   { background: var(--cyan);    box-shadow: 0 0 6px var(--cyan); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--cyan);
  color: var(--navy);
}
.btn-primary:hover { background: #0891B2; }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--silver);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(244,63,94,0.3);
}
.btn-danger-ghost:hover { background: rgba(244,63,94,0.1); }

/* ── CHAT BUBBLES ── */
.chat-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.bubble-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.bubble-row.bot { flex-direction: row-reverse; }

.bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.bubble.user {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--silver);
  border-bottom-left-radius: 4px;
}

.bubble.bot {
  background: rgba(6,182,212,0.15);
  border: 1px solid rgba(6,182,212,0.3);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.bubble-time {
  font-size: 10px;
  color: var(--muted);
  padding: 0 4px;
  flex-shrink: 0;
}

.bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar-user { background: rgba(255,255,255,0.08); color: var(--muted); }
.avatar-bot  { background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-bdr); }

/* ── INPUT / FORM ── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: rgba(4,13,26,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

select option { background: var(--navy2); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(7,20,40,0.9);
  border: 1px solid var(--cyan-bdr);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.login-logo {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto 8px;
  filter: brightness(1.1) drop-shadow(0 0 6px rgba(6,182,212,0.3));
}

.login-product {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.login-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}

.login-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}

.error-msg {
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.3);
  color: var(--danger);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.search-bar input { flex: 1; }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cyan-bdr), transparent);
  margin: 20px 0;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* ── BACK LINK ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--cyan); }

/* ── CHAT HEADER ── */
.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-customer {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.chat-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 14px; }
  .main { padding: 16px 14px; }
  .nav-links { display: none; }
  .nav-product { display: none; }
}
