:root {
  --primary: #00529C; /* Deep BHXH blue */
  --primary-light: #0077C8;
  --bg-color: #F4F9FF; /* Light sky blue background */
  --card-bg: #FFFFFF;
  --text-main: #1A365D;
  --text-sub: #4A5568;
  --border: rgba(0, 82, 156, 0.15);
  --success: #38A169;
  --warning: #D69E2E;
  --danger: #E53E3E;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Glassmorphism for light theme */
.glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 6px rgba(0, 82, 156, 0.05);
  border-radius: 16px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism utility */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

/* Layout */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.header {
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 82, 156, 0.2);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Screens */
.screen {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-sub);
}
.form-control {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #F9FAFB;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus {
  border-color: var(--primary);
}

.btn {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(0, 82, 156, 0.3);
}
.btn-zalo {
  background: linear-gradient(135deg, #0068ff, #0054cc);
  color: white;
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.4);
  margin-top: 10px;
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}
.stat-card {
  padding: 15px;
  text-align: center;
}
.stat-card h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.stat-card p {
  font-size: 12px;
  color: var(--text-sub);
}
.stat-card.orange h3 { color: var(--warning); }
.stat-card.blue h3 { color: var(--primary); }

/* Customer List */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.list-header h2 { font-size: 18px; }
.badge {
  background: rgba(0, 82, 156, 0.1);
  color: var(--primary);
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.customer-card {
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.customer-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--warning);
}
.customer-card.sent::before { background: var(--success); }

.c-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.c-info { font-size: 13px; color: var(--text-sub); margin-bottom: 2px; }
.c-phone { color: var(--primary); font-weight: 500; }

.c-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255,204,0,0.1);
  color: var(--warning);
}
.customer-card.sent .c-status {
  background: rgba(52,199,89,0.1);
  color: var(--success);
}

/* Toast */
#toast {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(50,50,50,0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 14px;
  transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  backdrop-filter: blur(5px);
  white-space: nowrap;
}
#toast.show { bottom: 30px; }

/* Loader */
#loader {
  display: none;
  text-align: center;
  padding: 20px;
  color: var(--text-sub);
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
