/* ==========================================================================
   SỔ NỢ 4.0 SAAS - MODERN DESIGN SYSTEM & STYLING
   Domain: th.giangkoi.com
   ========================================================================== */

:root {
  /* Color Palette - Light Theme */
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-sidebar: #1e293b;
  
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --danger-color: #dc2626;
  --danger-bg: #fef2f2;
  --danger-hover: #b91c1c;
  
  --warning-color: #d97706;
  --warning-bg: #fffbe6;
  
  --success-color: #16a34a;
  --success-bg: #f0fdf4;
  
  --border-color: #e2e8f0;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

body.dark-theme {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-header: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  
  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  
  --border-color: #334155;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* LOGIN SCREEN STYLING (ĐĂNG NHẬP BẢO MẬT) */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 36px 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-color), #4f46e5);
  color: #fff;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  margin-bottom: 12px;
}

.login-brand h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.btn-login-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-login-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.login-error-msg {
  background: var(--danger-bg);
  color: var(--danger-color);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-demo-hints {
  margin-top: 24px;
  background: var(--bg-main);
  border: 1px dashed var(--border-color);
  padding: 14px;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
}

.hint-title {
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}

.login-demo-hints ul {
  list-style: none;
}

.login-demo-hints li {
  margin-bottom: 4px;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-logout {
  background: var(--danger-bg);
  color: var(--danger-color);
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  background: var(--danger-color);
  color: #fff;
}

/* Top Demo Control Bar */
.demo-bar {
  background: linear-gradient(90deg, #1e1b4b, #312e81);
  color: #fff;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.demo-info i {
  color: #fbbf24;
  margin-right: 6px;
}

.demo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-select {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.demo-select option {
  background: #1e1b4b;
  color: #fff;
}

.btn-demo-toggle, .btn-theme-toggle {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-demo-toggle:hover, .btn-theme-toggle:hover {
  background: rgba(255,255,255,0.35);
}

/* 7-DAY EXPIRATION WARNING BANNER */
.sub-warning-banner {
  background: linear-gradient(90deg, #fffbe6, #fef3c7);
  border: 1px solid #f59e0b;
  border-left: 6px solid #d97706;
  color: #92400e;
  border-radius: var(--border-radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
  animation: pulseWarning 2s infinite ease-in-out;
}

@keyframes pulseWarning {
  0% { box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15); }
  50% { box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35); }
  100% { box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15); }
}

.warning-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.warning-icon {
  font-size: 1.5rem;
  color: #d97706;
}

.highlight-days {
  color: #dc2626;
  font-size: 1rem;
  font-weight: 800;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-warning-renew {
  background: #d97706;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-warning-renew:hover {
  background: #b45309;
  transform: translateY(-1px);
}

/* Layout Grid */
.app-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

/* Header & Navigation */
.app-header {
  background: var(--bg-header);
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--primary-color), #4f46e5);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary-color);
}

.store-subname {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.badge-sub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  background: var(--success-bg);
  color: var(--success-color);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 2px;
}

.badge-sub.warning-badge {
  background: #fffbe6;
  color: #d97706;
}

.badge-sub.expired {
  background: var(--danger-bg);
  color: var(--danger-color);
}

/* Navigation Buttons */
.main-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-main);
  padding: 6px;
  border-radius: 10px;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-btn.active {
  background: var(--bg-card);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.nav-btn.super-admin-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.nav-btn.super-admin-btn.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.4);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-main);
  padding: 6px 14px;
  border-radius: 30px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-email {
  font-weight: 600;
  font-size: 0.85rem;
}

.user-role-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  background: var(--primary-color);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* SUPER ADMIN CONTROL PANEL STYLING */
.super-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--primary-color);
}

.super-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sa-store-table th {
  background: #1e1b4b;
  color: #fff;
}

.sa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.sa-status-badge.active { background: var(--success-bg); color: var(--success-color); }
.sa-status-badge.warning { background: var(--warning-bg); color: var(--warning-color); }
.sa-status-badge.expired { background: var(--danger-bg); color: var(--danger-color); }

.sa-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-renew {
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary-light);
  color: var(--primary-color);
  transition: background 0.2s;
}

.btn-renew:hover { background: var(--primary-color); color: #fff; }

.btn-lock {
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--danger-bg);
  color: var(--danger-color);
}

.btn-lock:hover { background: var(--danger-color); color: #fff; }

.btn-delete-store {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.btn-delete-store:hover { color: var(--danger-color); }

/* Main Content Views */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.metric-card.danger::before { background: var(--danger-color); }
.metric-card.warning::before { background: var(--warning-color); }
.metric-card.info::before { background: var(--primary-color); }
.metric-card.success::before { background: var(--success-color); }
.metric-card.highlight::before { background: #8b5cf6; }

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.metric-card.danger .metric-icon { background: var(--danger-bg); color: var(--danger-color); }
.metric-card.warning .metric-icon { background: var(--warning-bg); color: var(--warning-color); }
.metric-card.info .metric-icon { background: var(--primary-light); color: var(--primary-color); }
.metric-card.success .metric-icon { background: var(--success-bg); color: var(--success-color); }
.metric-card.highlight .metric-icon { background: #f3e8ff; color: #8b5cf6; }

.metric-body {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 2px 0;
}

.metric-card.danger .metric-value { color: var(--danger-color); }

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.debtor-name {
  font-size: 1.25rem;
  color: #8b5cf6;
}

.debtor-amount {
  font-weight: 700;
  color: var(--danger-color);
}

/* Quick Actions Bar */
.quick-actions-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-action {
  border: none;
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-action.primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-action.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-action.voice {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
}

.btn-action.voice:hover {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-action.secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-action.secondary:hover {
  background: var(--bg-main);
}

.btn-action.sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Chart Container Card */
.chart-container-card, .card-container {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.card-header {
  margin-bottom: 20px;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.chart-wrapper {
  position: relative;
  height: 320px;
  width: 100%;
}

/* Customers View */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box-container {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box-container input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.search-box-container input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

/* Customers Grid Cards */
.customers-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.customer-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.customer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.customer-card-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.customer-card-phone {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.customer-card-debt {
  text-align: right;
}

.debt-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.debt-amount {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--danger-color);
}

.debt-amount.zero {
  color: var(--success-color);
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

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

.data-table th {
  background: var(--bg-main);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.data-table td {
  font-size: 0.9rem;
}

/* FORMAT RULES: RED HIGHLIGHT FOR NEGATIVE TRANSACTIONS (PAYMENTS) */
.transaction-table tr.tx-payment {
  background-color: var(--danger-bg) !important;
}

.transaction-table tr.tx-payment td {
  color: var(--danger-color) !important;
  font-weight: 600;
}

.transaction-table tr.tx-payment td.tx-amount {
  font-weight: 800;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-dialog.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3, .modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-modal-close:hover { color: var(--danger-color); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-main);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.required { color: var(--danger-color); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary-color);
}

/* Amount Input & Mask */
.amount-input-wrapper {
  position: relative;
}

.amount-input {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  padding-right: 40px;
}

.currency-tag {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--text-secondary);
}

.amount-preview-badge {
  margin-top: 8px;
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
}

/* Segmented Control for Radio */
.segmented-control {
  display: flex;
  gap: 10px;
}

.segment-option {
  flex: 1;
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-option input { display: none; }

.segment-option.option-debt { color: var(--danger-color); }
.segment-option.option-pay { color: var(--success-color); }

.segment-option input:checked + span {
  font-weight: 700;
}

.segment-option:has(input:checked) {
  border-width: 2px;
}

.segment-option.option-debt:has(input:checked) {
  border-color: var(--danger-color);
  background: var(--danger-bg);
}

.segment-option.option-pay:has(input:checked) {
  border-color: var(--success-color);
  background: var(--success-bg);
}

/* Customer Detail View Styling */
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-zalo-share {
  background: #0068ff;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 104, 255, 0.3);
}

.btn-zalo-share:hover { background: #0052cc; }

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.summary-box {
  background: var(--bg-main);
  padding: 14px;
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
}

.summary-amount {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.summary-amount.danger { color: var(--danger-color); }

.customer-note-section {
  background: var(--warning-bg);
  border: 1px dashed var(--warning-color);
  padding: 14px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
}

.customer-note-section label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warning-color);
  display: block;
  margin-bottom: 6px;
}

.note-edit-row {
  display: flex;
  gap: 10px;
}

.note-edit-row input {
  flex: 1;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
}

.transaction-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Voice Modal Pulsing Mic */
.voice-mic-container {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-mic-pulse {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: transform 0.2s;
}

.btn-mic-pulse.recording {
  background: var(--danger-color);
  animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 20px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.voice-status {
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.speech-transcript-box {
  background: var(--bg-main);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.transcript-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.transcript-text {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-primary);
  min-height: 24px;
}

.voice-result-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  text-align: left;
}

.voice-result-box h4 {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.parsed-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.parsed-item .highlight-amount {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--danger-color);
}

.hidden { display: none !important; }

/* SAAS SUBSCRIPTION LOCK SCREEN */
.lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.lock-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  max-width: 900px;
  width: 100%;
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--danger-color);
}

.lock-header {
  text-align: center;
  margin-bottom: 24px;
}

.lock-icon-badge {
  width: 60px;
  height: 60px;
  background: var(--danger-bg);
  color: var(--danger-color);
  font-size: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.lock-header h2 {
  font-family: var(--font-display);
  color: var(--danger-color);
  font-size: 1.5rem;
}

.lock-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.lock-notice {
  background: #fffbe6;
  color: #b45309;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.pricing-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pricing-card {
  background: var(--bg-main);
  border-radius: var(--border-radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.popular {
  border: 2px solid var(--primary-color);
  background: var(--bg-card);
}

.badge-popular {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 700;
}

.plan-name { font-weight: 700; font-size: 1.05rem; }
.plan-price { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--primary-color); margin: 6px 0; }
.plan-price span { font-size: 0.8rem; color: var(--text-secondary); font-weight: 400; }
.plan-discount { font-size: 0.75rem; color: var(--success-color); font-weight: 700; margin-bottom: 10px; }

.plan-features {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.plan-features li {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-features li i { color: var(--success-color); }

.payment-info-box {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  background: var(--bg-main);
  padding: 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .payment-info-box { grid-template-columns: 1fr; }
}

.qr-frame {
  text-align: center;
  background: #fff;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
}

.qr-img { width: 160px; height: 160px; }
.qr-frame span { font-size: 0.75rem; color: #64748b; font-weight: 600; display: block; margin-top: 4px; }

.bank-details-column h4 { font-size: 0.95rem; margin-bottom: 10px; }
.bank-list { list-style: none; font-size: 0.85rem; margin-bottom: 16px; }
.bank-list li { margin-bottom: 6px; }

.copyable { cursor: pointer; color: var(--primary-color); }
.copyable:hover { text-decoration: underline; }
.highlight-syntax { background: var(--warning-bg); color: var(--warning-color); padding: 2px 6px; border-radius: 4px; }

.hotline-contact p { font-size: 0.85rem; margin-bottom: 10px; }
.contact-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-contact-zalo {
  background: #0068ff;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-contact-phone {
  background: var(--success-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Login Toggle Switch */
.login-role-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 10px;
}

.toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-slider.round {
  border-radius: 34px;
}

.toggle-slider.round:before {
  border-radius: 50%;
}

.btn-change-pwd {
  background: var(--warning-bg);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  transition: all 0.2s;
}

.btn-change-pwd:hover {
  background: var(--warning-color);
  color: #fff;
}

/* Responsive Mobile Improvements */
@media (max-width: 768px) {
  .app-header { flex-direction: column; gap: 14px; align-items: stretch; }
  .main-nav { width: 100%; justify-content: space-between; }
  .header-user { justify-content: space-between; }
  .detail-summary-grid { grid-template-columns: 1fr; }
  .sub-warning-banner { flex-direction: column; text-align: center; }
}
