/* ============================================================
   INDOCHINATRADE - Design System
   Professional B2B Platform: Indonesia ↔ China
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --navy:        #1a3560;
  --navy-dark:   #0f2240;
  --navy-light:  #2a4f8a;
  --gold:        #e8a020;
  --gold-light:  #f5b942;
  --red-accent:  #c0392b;
  --white:       #ffffff;
  --off-white:   #f4f6fa;
  --gray-100:    #f0f2f7;
  --gray-200:    #e2e6ef;
  --gray-400:    #9aa4bc;
  --gray-600:    #5a6480;
  --gray-800:    #2c3554;
  --text-dark:   #1a2035;
  --text-muted:  #6b7491;
  --success:     #27ae60;
  --warning:     #f39c12;
  --danger:      #e74c3c;
  --info:        #2980b9;

  --shadow-sm:   0 2px 8px rgba(26,53,96,0.08);
  --shadow-md:   0 4px 20px rgba(26,53,96,0.12);
  --shadow-lg:   0 8px 40px rgba(26,53,96,0.18);
  --shadow-xl:   0 16px 60px rgba(26,53,96,0.22);

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  --transition:  all 0.25s ease;
  --transition-fast: all 0.15s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition-fast); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy-dark);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p  { color: var(--gray-600); }

.text-white  { color: var(--white) !important; }
.text-gold   { color: var(--gold) !important; }
.text-navy   { color: var(--navy) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.flex    { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.gap-24  { gap: 24px; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-sell  { background: #fff0e6; color: #d06015; }
.badge-buy   { background: #e6f0ff; color: #1a5bbf; }
.badge-china { background: #fff0f0; color: #c0392b; }
.badge-indo  { background: #f0fff0; color: #1a7a3c; }
.badge-new   { background: var(--gold); color: var(--white); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232,160,32,0.4);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
}
.btn-navy:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 2px solid var(--navy);
  color: var(--navy);
  background: transparent;
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-outline-white {
  border: 2px solid rgba(255,255,255,0.6);
  color: var(--white);
  background: transparent;
}
.btn-outline-white:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--white);
}

.btn-sm  { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg  { padding: 16px 40px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card-body { padding: 24px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
}
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

/* Offer Card */
.offer-card { position: relative; }
.offer-card .offer-type {
  position: absolute;
  top: 16px;
  right: 16px;
}
.offer-card .offer-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin: 8px 0 6px;
}
.offer-card .offer-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.offer-card .offer-category {
  font-size: 0.8rem;
  color: var(--navy);
  background: var(--gray-100);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin: 10px 0;
}
.offer-card .offer-desc {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin: 8px 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.offer-card .offer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
  margin-top: 4px;
}

/* Member Card */
.member-card { text-align: center; padding: 32px 24px; }
.member-card .member-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--gray-200);
}
.member-card .member-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 auto 16px;
}
.member-card .member-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-dark);
}
.member-card .member-country {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 4px 0 12px;
}
.member-card .member-category {
  font-size: 0.8rem;
  color: var(--navy);
  background: var(--gray-100);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 16px;
}

/* --- Navigation --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy-dark);
  flex-shrink: 0;
}
.navbar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.1rem;
}
.navbar-brand span.gold { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition-fast);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--navy);
  background: var(--gray-100);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 4px;
}
.lang-switcher button {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition-fast);
}
.lang-switcher button.active {
  background: var(--navy);
  color: var(--white);
}
.lang-switcher button:hover:not(.active) {
  background: var(--gray-200);
  color: var(--navy);
}

/* Mobile Menu */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(232,160,32,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero h1 {
  color: var(--white);
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.hero p.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-flags {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-flag-box {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  min-width: 280px;
}
.hero-flag-box .flag-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 8px;
}
.hero-flag-box .exchange-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin: 20px 0;
}
.hero-flag-box h3 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
}
.hero-flag-box p {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Hero Stats Bar */
.stats-bar {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 28px 40px;
  margin-top: -40px;
  position: relative;
  z-index: 10;
}
.stat-item { text-align: center; }
.stat-item .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1;
}
.stat-item .stat-num span { color: var(--gold); }
.stat-item .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-divider {
  width: 1px;
  height: 50px;
  background: var(--gray-200);
}

/* --- Features Section --- */
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: var(--navy-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
}
.feature-card h3 { margin-bottom: 10px; }
.feature-card p { font-size: 0.9rem; }

/* --- Section Header --- */
.section-header { text-align: center; margin-bottom: 56px; }
.section-eyebrow {
  display: inline-block;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gray-100);
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 14px; }
.section-header p { max-width: 560px; margin: 0 auto; }

/* --- How It Works --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.step-item {
  text-align: center;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}
.step-num {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 16px rgba(26,53,96,0.25);
  border: 4px solid var(--white);
}
.step-item h4 { margin-bottom: 8px; }
.step-item p { font-size: 0.85rem; }

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232,160,32,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 7px;
}
.form-label span.req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,53,96,0.12);
}
.form-control::placeholder { color: var(--gray-400); }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa4bc' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.form-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check input { margin-top: 3px; accent-color: var(--navy); }
.form-check label { font-size: 0.88rem; color: var(--gray-600); cursor: pointer; }

/* Auth Page */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: linear-gradient(160deg, var(--navy-dark), var(--navy));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  color: white;
}
.auth-left h2 { color: white; margin-bottom: 12px; }
.auth-left p { color: rgba(255,255,255,0.7); text-align: center; }
.auth-illustration {
  font-size: 5rem;
  margin-bottom: 32px;
  display: block;
}
.auth-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  overflow-y: auto;
}
.auth-box { width: 100%; max-width: 440px; }
.auth-box h2 { margin-bottom: 6px; }
.auth-box .auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* --- Dashboard Layout --- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--navy-dark);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
}
.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-dark);
  font-size: 1rem;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 8px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  margin-bottom: 2px;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,0.1);
  color: white;
}
.sidebar-link.active { background: rgba(232,160,32,0.2); color: var(--gold); }
.sidebar-link .link-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--red-accent);
  color: white;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-dark);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-country {
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
}

.main-content {
  background: var(--off-white);
  padding: 32px;
  min-height: 100vh;
}
.page-header {
  margin-bottom: 28px;
}
.page-header h2 { margin-bottom: 4px; }
.page-header p { font-size: 0.9rem; }

/* Dashboard KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
}
.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-icon.navy { background: rgba(26,53,96,0.1); }
.kpi-icon.gold { background: rgba(232,160,32,0.12); }
.kpi-icon.green { background: rgba(39,174,96,0.12); }
.kpi-icon.red { background: rgba(192,57,43,0.12); }
.kpi-num { font-size: 1.8rem; font-weight: 800; color: var(--navy-dark); line-height: 1; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }

/* --- Messages / Chat --- */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 200px);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.thread-list { border-right: 1px solid var(--gray-200); overflow-y: auto; }
.thread-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 1rem;
}
.thread-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--gray-100);
}
.thread-item:hover, .thread-item.active {
  background: var(--gray-100);
}
.thread-item.active { background: rgba(26,53,96,0.06); }
.thread-item.unread .thread-name { font-weight: 700; }
.thread-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.thread-info { flex: 1; min-width: 0; }
.thread-name { font-size: 0.9rem; font-weight: 600; color: var(--navy-dark); }
.thread-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.thread-time { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }

.chat-area { display: flex; flex-direction: column; }
.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 14px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.msg-row.mine { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}
.msg-row:not(.mine) .msg-bubble {
  background: var(--gray-100);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
}
.msg-row.mine .msg-bubble {
  background: var(--navy);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-time { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; text-align: right; }
.msg-row:not(.mine) .msg-time { text-align: left; }

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.9rem;
  outline: none;
  resize: none;
  height: 44px;
  max-height: 120px;
  transition: var(--transition-fast);
}
.chat-input:focus { border-color: var(--navy); }

/* --- Filter Bar --- */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-control { max-width: 220px; }
.filter-bar .form-select { max-width: 180px; }
.filter-count { font-size: 0.85rem; color: var(--text-muted); margin-left: auto; }

/* --- Footer --- */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 0;
}
.footer h4 { color: var(--white); margin-bottom: 16px; font-size: 1rem; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer ul a:hover { color: var(--gold); }
.footer-brand-desc { font-size: 0.88rem; margin-top: 12px; max-width: 260px; }
.footer-bottom {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}
.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--gold); }

/* --- Alerts --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: #e8f8ef; color: #1a6b3c; border: 1px solid #b2dfca; }
.alert-danger  { background: #fdf0ef; color: #c0392b; border: 1px solid #f5c2be; }
.alert-info    { background: #eef5fd; color: #1a5bbf; border: 1px solid #bcd5f5; }
.alert-warning { background: #fffbeb; color: #92610a; border: 1px solid #fde68a; }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gray-100);
  color: var(--navy-dark);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-200);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-600); }
.data-table tr:hover td { background: var(--gray-100); }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; gap: 6px; }
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
  transition: var(--transition-fast);
  cursor: pointer;
  background: white;
}
.page-btn:hover, .page-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { color: var(--navy-dark); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; max-width: 320px; margin: 0 auto 24px; }

/* --- Utility --- */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.p-4   { padding: 4px; }
.p-16  { padding: 16px; }
.p-24  { padding: 24px; }

.bg-navy   { background: var(--navy); }
.bg-light  { background: var(--gray-100); }
.rounded   { border-radius: var(--radius-md); }
.w-100     { width: 100%; }
.d-none    { display: none; }
.overflow-hidden { overflow: hidden; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .steps-grid::before { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .hero { padding: 60px 0 60px; }
  .hero-flags { display: none; }
  .grid-2, .grid-3, .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
  .stats-bar .flex { flex-wrap: wrap; gap: 24px; }
  .stat-divider { display: none; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control, .filter-bar .form-select { max-width: 100%; }
  .filter-count { margin-left: 0; }
  .messages-layout { grid-template-columns: 1fr; }
  .thread-list { height: 300px; border-right: none; border-bottom: 1px solid var(--gray-200); }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .navbar-right .btn { display: none; }
  .section { padding: 56px 0; }
  .main-content { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.5s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
