/* SiteBuildIndia Portal - Main CSS */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #06b6d4;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1e40af;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #fff;
  --sidebar-width: 260px;
  --header-height: 64px;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(15,23,42,.08);
  --shadow-lg: 0 8px 32px rgba(15,23,42,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--body-bg); color: var(--text-dark); line-height: 1.6; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width);
  background: var(--sidebar-bg); overflow-y: auto; overflow-x: hidden;
  transition: width .3s ease, transform .3s ease; z-index: 1000;
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar-brand {
  padding: 20px 20px 16px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #1e293b; flex-shrink: 0;
}
.sidebar-brand .brand-icon {
  width: 52px; height: 52px; background: transparent;
  border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.sidebar-brand .brand-icon img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; display: block; }
.sidebar-brand .brand-icon i { color: #fff; font-size: 18px; }
.sidebar-brand .brand-text { overflow: hidden; min-width: 0; flex: 1; }
.sidebar-brand .brand-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; }
.sidebar-brand .brand-role { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { margin-bottom: 4px; }
.nav-section-title {
  font-size: 10px; font-weight: 600; color: #475569; text-transform: uppercase;
  letter-spacing: .8px; padding: 8px 20px 4px; white-space: nowrap;
}
.nav-item { padding: 2px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border-radius: 8px; color: var(--sidebar-text); text-decoration: none;
  font-size: 13px; font-weight: 500; transition: all .2s; white-space: nowrap; position: relative;
}
.nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-text-active); }
.nav-link .nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-link .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: 10px; line-height: 1.6;
}

.sidebar-footer {
  padding: 12px 10px; border-top: 1px solid #1e293b;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; transition: background .2s;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user .user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.sidebar-user .user-info { overflow: hidden; }
.sidebar-user .user-name { font-size: 12px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-email { font-size: 10px; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== MAIN LAYOUT ===== */
.main-wrapper { margin-left: var(--sidebar-width); transition: margin-left .3s ease; min-height: 100vh; display: flex; flex-direction: column; }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--header-height); background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--text-dark); font-size: 18px; }
.topbar-toggle:hover { background: var(--body-bg); }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-dark); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--body-bg); border: none; cursor: pointer; color: var(--text-muted);
  font-size: 15px; text-decoration: none; position: relative; transition: background .2s;
}
.topbar-btn:hover { background: var(--border); color: var(--text-dark); }
.topbar-badge {
  position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; background: var(--danger);
  border-radius: 50%; font-size: 9px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ===== PAGE CONTENT ===== */
.page-content { flex: 1; padding: 24px; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== CARDS ===== */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.card-body { padding: 20px; }

/* ===== STATS CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.blue { background: #eff6ff; color: #1d4ed8; }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-icon.cyan { background: #ecfeff; color: #0891b2; }
.stat-icon.red { background: #fef2f2; color: #dc2626; }
.stat-info .stat-value { font-size: 24px; font-weight: 700; color: var(--text-dark); line-height: 1.2; }
.stat-info .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-info .stat-change { font-size: 11px; margin-top: 4px; }
.stat-info .stat-change.up { color: var(--success); }
.stat-info .stat-change.down { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; border: none; cursor: pointer; text-decoration: none; font-family: inherit; transition: all .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.btn-primary:hover { opacity: .9; box-shadow: 0 4px 12px rgba(30,64,175,.3); }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-info { background: #06b6d4; color: #fff; }
.btn-info:hover { background: #0891b2; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--body-bg); color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-dark); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #128c7e; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th { padding: 10px 14px; font-weight: 600; color: var(--text-muted); background: #f8fafc; border-bottom: 2px solid var(--border); text-align: left; white-space: nowrap; }
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-dark); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .actions { display: flex; gap: 4px; align-items: center; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #f0fdf4; color: #16a34a; }
.badge-danger { background: #fef2f2; color: #dc2626; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-info { background: #ecfeff; color: #0891b2; }
.badge-primary { background: #eff6ff; color: #1d4ed8; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* ===== FORMS ===== */
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-dark); }
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--text-dark); background: #fff;
  transition: border-color .2s, box-shadow .2s; outline: none; width: 100%;
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-control:disabled { background: #f8fafc; color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; }

/* ===== FILTERS BAR ===== */
.filters-bar { background: var(--card-bg); padding: 14px 20px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 16px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters-bar .form-group { min-width: 150px; flex: 1; margin: 0; }
.search-input { position: relative; }
.search-input i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.search-input input { padding-left: 34px; }

/* ===== MODALS ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 2000; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 800px; }
.modal-sm { max-width: 420px; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: var(--body-bg); border-radius: 8px; cursor: pointer; color: var(--text-muted); font-size: 15px; transition: background .2s; }
.modal-close:hover { background: var(--border); color: var(--text-dark); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: #fff; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fed7aa; color: #92400e; }
.alert-info { background: #ecfeff; border: 1px solid #a5f3fc; color: #164e63; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-link { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-muted); text-decoration: none; transition: all .2s; }
.page-link:hover, .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state i { font-size: 48px; opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; color: var(--text-dark); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ===== TOAST ===== */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 380px; animation: slideUp .3s ease; }
.toast-success { background: #166534; color: #fff; }
.toast-error { background: #991b1b; color: #fff; }
.toast-info { background: #1e40af; color: #fff; }
.toast-warning { background: #92400e; color: #fff; }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 10px 18px; font-size: 13px; font-weight: 500; color: var(--text-muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; white-space: nowrap; font-family: inherit; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text-dark); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== CHARTS ===== */
.chart-container { position: relative; }

/* ===== PROGRESS ===== */
.progress { background: #e2e8f0; border-radius: 10px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); transition: width .6s ease; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content:''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border); }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.timeline-content { font-size: 13px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
  .modal { max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 95vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-header { flex-direction: column; }
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }
.sidebar-overlay.active { display: block; }

/* ===== MISC ===== */
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mb-4 { margin-bottom: 16px; } .mt-4 { margin-top: 16px; }
.text-muted { color: var(--text
/* ===== TAB NAVIGATION ===== */
.tab-nav { display: flex; gap: 6px; background: var(--card-bg); padding: 5px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.06); width: fit-content; margin-bottom: 20px; }
.tab-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 20px; font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none; border-radius: 8px; transition: all .18s; white-space: nowrap; }
.tab-link:hover { color: var(--text-dark); background: #f1f5f9; }
.tab-link.active { color: #fff; background: linear-gradient(135deg, #1e40af, #3b82f6); font-weight: 600; box-shadow: 0 2px 8px rgba(59,130,246,.3); }
.tab-link .badge { font-size: 10px; padding: 2px 7px; line-height: 1.4; border-radius: 20px; }
.tab-link.active .badge { background: rgba(255,255,255,.25); color: #fff; }
.tab-link:not(.active) .badge-warning { background: #fffbeb; color: #d97706; }
.tab-link:not(.active) .badge-secondary { background: #f1f5f9; color: #64748b; }
