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

/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #f4f6fb;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255,255,255,0.95);
  --bg-glass: rgba(0,0,0,0.03);
  --border-glass: rgba(0,0,0,0.1);
  --text-primary: #1a1a2e;
  --text-secondary: #555570;
  --text-muted: #8888a0;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --gold: #d4920a;
  --gold-light: #ffd166;
  --success: #1fb864;
  --warning: #e6930a;
  --info: #1e7fd9;
  --danger: #e63946;
  --sidebar-width: 260px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Outfit', sans-serif; font-weight: 600; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: 'Inter', sans-serif; border: none; outline: none; }
input, select, textarea { font-family: 'Inter', sans-serif; outline: none; }
ul { list-style: none; }
img { max-width: 100%; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #e8eaf0; }
::-webkit-scrollbar-thumb { background: #b0b4c0; border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
#loginPage {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: url('../images/login_bg.png') center/cover no-repeat;
}
#loginPage::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.75), rgba(240,242,248,0.8));
}
.login-container {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px; padding: 48px 40px; width: 420px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  animation: fadeUp 0.6s ease;
}
.login-container .logo { text-align: center; margin-bottom: 32px; }
.login-container .logo h1 { font-size: 2rem; color: var(--accent); letter-spacing: 2px; }
.login-container .logo p { color: #666; font-size: 0.85rem; margin-top: 4px; }
.login-container .logo .icon { font-size: 3rem; margin-bottom: 8px; display: block; }

.form-group { margin-bottom: 20px; position: relative; }
.form-group label { display: block; font-size: 0.8rem; color: #666; margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.form-group input {
  width: 100%; padding: 14px 16px 14px 44px; border-radius: var(--radius-sm);
  border: 1px solid #d5d7e0; background: #fff;
  color: #1a1a2e; font-size: 0.95rem;
  transition: var(--transition);
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,0.12); }
.form-group .input-icon { position: absolute; left: 14px; top: 38px; color: #999; font-size: 1rem; }

.btn {
  padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.95rem; transition: var(--transition); display: inline-flex;
  align-items: center; gap: 8px; justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c0392b);
  color: #fff; width: 100%;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(233,69,96,0.4); }
.btn-secondary { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #e6950a); color: #0a0a1a; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(240,165,0,0.4); }
.btn-success { background: linear-gradient(135deg, var(--success), #1fb864); color: #fff; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #e63946); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: 6px; }
.btn-icon { padding: 8px 12px; font-size: 1rem; border-radius: 8px; background: var(--bg-glass); color: var(--text-secondary); border: 1px solid var(--border-glass); }
.btn-icon:hover { color: var(--gold); border-color: var(--gold); }

.login-error { color: var(--danger); font-size: 0.82rem; text-align: center; margin-top: 12px; min-height: 20px; }
.login-attempts { color: var(--text-muted); font-size: 0.75rem; text-align: center; margin-top: 8px; }

/* ===== APP LAYOUT ===== */
#appContainer { display: none; min-height: 100vh; }
#appContainer.active { display: flex; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width); height: 100vh; position: fixed; left: 0; top: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; z-index: 100;
  transition: var(--transition); overflow: hidden;
}
.sidebar-header {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: center; flex-shrink: 0;
}
.sidebar-header h2 { font-size: 1.3rem; color: #f0a500; letter-spacing: 1px; }
.sidebar-header p { font-size: 0.7rem; color: rgba(255,255,255,0.45); margin-top: 2px; text-transform: uppercase; letter-spacing: 2px; }

.sidebar-nav {
  flex: 1; padding: 16px 12px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-radius: var(--radius-sm); margin-bottom: 4px; color: rgba(255,255,255,0.6);
  transition: var(--transition); font-size: 0.9rem; font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, rgba(233,69,96,0.25), rgba(233,69,96,0.1)); color: #ff6b81; border: 1px solid rgba(233,69,96,0.3); }
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 0; }

.sidebar-footer {
  padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}
.user-info { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #f0a500); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; color: #fff; }
.user-details { flex: 1; }
.user-details .name { font-size: 0.85rem; font-weight: 600; color: #fff; }
.user-details .role { font-size: 0.7rem; color: rgba(255,255,255,0.45); }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width); flex: 1; min-height: 100vh;
  background: url('../images/dashboard_bg.png') center/cover no-repeat fixed;
  position: relative;
}
.main-content::before {
  content: ''; position: fixed; top: 0; left: var(--sidebar-width); right: 0; bottom: 0;
  background: rgba(244,246,251,0.88); z-index: 0; pointer-events: none;
}
.content-wrapper { position: relative; z-index: 1; padding: 28px 32px; }

/* Page Header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 1.6rem; display: flex; align-items: center; gap: 10px; color: #1a1a2e; }
.page-header h1 i { color: var(--accent); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--accent); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: var(--transition);
}
.card:hover { border-color: rgba(255,255,255,0.15); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-header h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--accent); font-size: 1.1rem; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card); backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass); border-radius: var(--radius);
  padding: 22px 20px; display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.12); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-size: 1.3rem;
}
.stat-icon.red { background: rgba(233,69,96,0.15); color: var(--accent); }
.stat-icon.gold { background: rgba(240,165,0,0.15); color: var(--gold); }
.stat-icon.green { background: rgba(46,213,115,0.15); color: var(--success); }
.stat-icon.blue { background: rgba(30,144,255,0.15); color: var(--info); }
.stat-info h4 { font-size: 1.5rem; font-weight: 700; }
.stat-info p { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* Dashboard Cards Grid */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.dash-card {
  background: var(--bg-card); backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass); border-radius: var(--radius);
  padding: 32px 24px; text-align: center; cursor: pointer;
  transition: var(--transition); position: relative; overflow: hidden;
}
.dash-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(233,69,96,0.08));
  transition: var(--transition);
}
.dash-card:hover { transform: translateY(-6px); box-shadow: 0 12px 36px rgba(0,0,0,0.12); border-color: var(--accent); }
.dash-card:hover::before { background: linear-gradient(135deg, transparent 40%, rgba(233,69,96,0.06)); }
.dash-card .card-icon { font-size: 2.5rem; margin-bottom: 16px; color: var(--accent); }
.dash-card h3 { font-size: 1.15rem; margin-bottom: 6px; position: relative; }
.dash-card p { font-size: 0.8rem; color: var(--text-secondary); position: relative; }

/* ===== TABLE ===== */
.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead { background: #f8f9fd; }
th { padding: 14px 16px; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid #e8eaf0; white-space: nowrap; }
td { padding: 13px 16px; font-size: 0.88rem; border-bottom: 1px solid #f0f1f5; color: var(--text-secondary); }
tr:hover td { background: #f8f9fd; color: var(--text-primary); }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.form-group-app { margin-bottom: 18px; }
.form-group-app label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group-app input,
.form-group-app select,
.form-group-app textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid #d5d7e0; background: #fff;
  color: var(--text-primary); font-size: 0.9rem; transition: var(--transition);
}
.form-group-app input:focus,
.form-group-app select:focus,
.form-group-app textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,0.1);
}
.form-group-app select option { background: #fff; color: var(--text-primary); }

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
  font-size: 0.85rem; color: var(--text-secondary); user-select: none;
}
.checkbox-item:hover { border-color: var(--gold); background: rgba(240,165,0,0.05); }
.checkbox-item input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px;
  border: 2px solid #d0d2da; border-radius: 4px;
  background: #fff; cursor: pointer; position: relative;
  transition: var(--transition); flex-shrink: 0; display: inline-block;
}
.checkbox-item.checked input[type="checkbox"] {
  background: var(--accent); border-color: var(--accent);
}
.checkbox-item.checked input[type="checkbox"]::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1;
}
.checkbox-item.checked { background: rgba(233,69,96,0.08); border-color: var(--accent); color: var(--accent); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border: 1px solid #e0e2ea;
  border-radius: var(--radius); padding: 32px; width: 560px; max-width: 90vw;
  max-height: 85vh; overflow-y: auto; animation: fadeUp 0.3s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; color: var(--text-muted); font-size: 1.5rem; padding: 4px; transition: var(--transition); }
.modal-close:hover { color: var(--danger); }

/* ===== BADGES ===== */
.badge {
  padding: 4px 10px; border-radius: 20px; font-size: 0.72rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: rgba(46,213,115,0.15); color: var(--success); }
.badge-warning { background: rgba(255,165,2,0.15); color: var(--warning); }
.badge-danger { background: rgba(255,71,87,0.15); color: var(--danger); }
.badge-info { background: rgba(30,144,255,0.15); color: var(--info); }
.badge-gold { background: rgba(240,165,0,0.15); color: var(--gold); }

/* ===== SEARCH & FILTER BAR ===== */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: #fff; border: 1px solid #d5d7e0;
  border-radius: var(--radius-sm); flex: 1; min-width: 220px;
}
.search-box i { color: var(--text-muted); }
.search-box input { background: transparent; border: none; color: var(--text-primary); flex: 1; font-size: 0.88rem; }
.filter-select {
  padding: 10px 14px; background: #fff; border: 1px solid #d5d7e0;
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem;
}
.filter-select option { background: #fff; }

/* ===== INVOICE ===== */
.invoice-preview {
  background: #fff; color: #1a1a2e; border-radius: var(--radius);
  padding: 40px; max-width: 800px; margin: 0 auto;
}
.invoice-preview .inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; border-bottom: 3px solid var(--gold); padding-bottom: 20px; }
.invoice-preview .inv-company h2 { color: var(--accent); font-size: 1.5rem; }
.invoice-preview .inv-company p { font-size: 0.8rem; color: #666; margin-top: 2px; }
.invoice-preview .inv-title { text-align: right; }
.invoice-preview .inv-title h1 { font-size: 2rem; color: #1a1a2e; letter-spacing: 3px; }
.invoice-preview .inv-title p { font-size: 0.85rem; color: #888; }
.invoice-preview .inv-details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.invoice-preview .inv-details h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #999; margin-bottom: 6px; }
.invoice-preview .inv-details p { font-size: 0.9rem; color: #333; margin-bottom: 2px; }
.invoice-preview table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.invoice-preview th { background: #1a1a2e; color: #fff; padding: 12px 16px; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; }
.invoice-preview td { padding: 12px 16px; border-bottom: 1px solid #eee; color: #333; font-size: 0.88rem; }
.invoice-preview .inv-total { text-align: right; }
.invoice-preview .inv-total .total-row { display: flex; justify-content: flex-end; gap: 40px; padding: 6px 0; font-size: 0.9rem; }
.invoice-preview .inv-total .grand-total { font-size: 1.2rem; font-weight: 700; color: var(--accent); border-top: 2px solid #1a1a2e; padding-top: 8px; margin-top: 4px; }

/* ===== CHARTS AREA ===== */
.chart-container { position: relative; height: 300px; margin-top: 16px; }
.chart-bar-group { display: flex; align-items: flex-end; gap: 8px; height: 250px; padding: 0 10px; }
.chart-bar {
  flex: 1; background: linear-gradient(180deg, var(--accent), rgba(233,69,96,0.3));
  border-radius: 6px 6px 0 0; transition: var(--transition); position: relative;
  min-width: 30px; cursor: pointer;
}
.chart-bar:hover { background: linear-gradient(180deg, var(--gold), rgba(240,165,0,0.3)); }
.chart-bar .bar-label { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.chart-bar .bar-value { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; color: var(--text-primary); font-weight: 600; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border-glass); padding-bottom: 0; }
.tab-btn {
  padding: 10px 20px; font-size: 0.85rem; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  transition: var(--transition); font-weight: 500;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ===== PAGE SECTIONS ===== */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeUp 0.4s ease; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm); font-size: 0.85rem;
  display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); min-width: 280px;
}
.toast-success { background: rgba(31,184,100,0.95); color: #fff; }
.toast-error { background: rgba(230,57,70,0.95); color: #fff; }
.toast-info { background: rgba(30,127,217,0.95); color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .main-content::before { left: 0; }
  .content-wrapper { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .invoice-preview { padding: 20px; }
  .invoice-preview .inv-details { grid-template-columns: 1fr; }
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.no-data { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.no-data i { font-size: 3rem; margin-bottom: 12px; display: block; color: #d0d2da; }
.no-data p { font-size: 0.9rem; }

/* Payment Mode Group */
.payment-mode-group {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.payment-mode-option {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  background: var(--bg-glass); border: 2px solid var(--border-glass);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
  font-size: 0.88rem; color: var(--text-secondary); user-select: none; flex: 1; min-width: 120px;
  justify-content: center;
}
.payment-mode-option:hover { border-color: var(--gold); background: rgba(240,165,0,0.05); }
.payment-mode-option.selected {
  border-color: var(--accent); background: rgba(233,69,96,0.08);
  color: var(--accent); font-weight: 600;
}
.payment-mode-option input[type="radio"] { display: none; }
.payment-mode-option i { font-size: 1.1rem; }

/* Account Balance Cards */
.account-balance-card { position: relative; overflow: hidden; }
.account-balance-card::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(233,69,96,0.06); pointer-events: none;
}

/* Mail Styles */
.mail-folder { display:flex; align-items:center; gap:8px; padding:9px 14px; border-radius:8px; cursor:pointer; font-size:0.82rem; color:var(--text-secondary); transition:all 0.2s; margin-bottom:2px; }
.mail-folder:hover { background:rgba(0,0,0,0.04); }
.mail-folder.active { background:rgba(233,69,96,0.08); color:var(--accent); font-weight:600; }
.mail-item { padding:12px 16px; border-bottom:1px solid #f0f1f5; cursor:pointer; transition:all 0.15s; }
.mail-item:hover { background:#f8f9fc; }
.mail-item.selected { background:rgba(233,69,96,0.06); border-left:3px solid var(--accent); }
.mail-item.unread { background:#fef9f0; }

/* ===== CHAT WIDGET ===== */
/* FAB Button */
.chat-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 800;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c0392b);
  color: #fff; font-size: 1.4rem; border: none; cursor: pointer;
  box-shadow: 0 6px 24px rgba(233,69,96,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  animation: chatFabPulse 2s infinite;
}
.chat-fab:hover {
  transform: scale(1.1) rotate(8deg);
  box-shadow: 0 8px 32px rgba(233,69,96,0.6);
}
.chat-fab-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--gold); color: #0a0a1a; font-size: 0.65rem;
  font-weight: 700; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
@keyframes chatFabPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(233,69,96,0.45); }
  50% { box-shadow: 0 6px 32px rgba(233,69,96,0.65), 0 0 0 8px rgba(233,69,96,0.1); }
}

/* Chat Box */
.chat-box {
  position: fixed; bottom: 100px; right: 28px; z-index: 801;
  width: 380px; height: 520px; max-height: 70vh;
  background: #fff; border-radius: 20px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.06);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(30px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(.4,0,.2,1),
              transform 0.35s cubic-bezier(.4,0,.2,1);
}
.chat-box.open {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Chat Header */
.chat-box-header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 16px 18px; display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-header-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.chat-box-header h4 { color: #fff; font-size: 0.95rem; font-family: 'Outfit', sans-serif; }
.chat-header-sub { color: rgba(255,255,255,0.5); font-size: 0.7rem; }
.chat-header-actions { display: flex; gap: 6px; }
.chat-header-btn {
  background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.7);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 0.9rem;
}
.chat-header-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Search */
.chat-search {
  padding: 10px 14px; border-bottom: 1px solid #f0f1f5;
  display: flex; align-items: center; gap: 8px;
}
.chat-search i { color: #bbb; font-size: 0.85rem; }
.chat-search input {
  border: none; background: transparent; flex: 1;
  font-size: 0.85rem; color: var(--text-primary); outline: none;
}

/* Contacts */
.chat-contacts {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.chat-contact-list {
  flex: 1; overflow-y: auto; padding: 6px 0;
}
.chat-contact-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; transition: all 0.15s; border-left: 3px solid transparent;
}
.chat-contact-item:hover { background: #f8f9fc; }
.chat-contact-item.unread {
  background: #fef9f0; border-left-color: var(--gold);
}
.chat-contact-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.chat-contact-info { flex: 1; min-width: 0; }
.chat-contact-top { display: flex; justify-content: space-between; align-items: center; }
.chat-contact-name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.chat-contact-time { font-size: 0.68rem; color: var(--text-muted); }
.chat-contact-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.chat-contact-preview {
  font-size: 0.78rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.chat-contact-badge {
  background: var(--accent); color: #fff; font-size: 0.6rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 50%; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-contact-id { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; display: block; }

/* Conversation */
.chat-conversation { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  background: linear-gradient(180deg, #f8f9fc, #fff);
}
.chat-date-sep {
  text-align: center; margin: 12px 0;
}
.chat-date-sep span {
  background: rgba(0,0,0,0.06); color: var(--text-muted);
  font-size: 0.68rem; padding: 3px 12px; border-radius: 12px;
}
.chat-msg { display: flex; margin-bottom: 6px; animation: chatMsgIn 0.25s ease; }
.chat-msg.mine { justify-content: flex-end; }
.chat-msg.theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 16px;
  font-size: 0.85rem; line-height: 1.5; position: relative; word-wrap: break-word;
}
.chat-msg.mine .chat-bubble {
  background: linear-gradient(135deg, var(--accent), #c0392b);
  color: #fff; border-bottom-right-radius: 4px;
}
.chat-msg.theirs .chat-bubble {
  background: #f0f1f5; color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  display: block; font-size: 0.6rem; margin-top: 4px;
  opacity: 0.6; text-align: right;
}
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Input Area */
.chat-input-area {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-top: 1px solid #f0f1f5;
  background: #fff; flex-shrink: 0;
}
.chat-input-area input {
  flex: 1; border: 1px solid #e0e2ea; border-radius: 24px;
  padding: 10px 16px; font-size: 0.85rem; color: var(--text-primary);
  background: #f8f9fc; outline: none; transition: all 0.2s;
}
.chat-input-area input:focus { border-color: var(--accent); background: #fff; }
.chat-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c0392b);
  color: #fff; border: none; cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(233,69,96,0.4); }

/* Empty State */
.chat-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; color: var(--text-muted);
  text-align: center; padding: 24px;
}
.chat-empty i { font-size: 2.5rem; margin-bottom: 12px; color: #d0d2da; }
.chat-empty p { font-size: 0.85rem; }

/* Mobile */
@media (max-width: 480px) {
  .chat-box { width: calc(100vw - 24px); right: 12px; bottom: 90px; height: 60vh; }
  .chat-fab { bottom: 16px; right: 16px; width: 54px; height: 54px; }
}
