/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: #f0f2f7;
  color: #1a1d2e;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100vh;
  background: linear-gradient(180deg, #0f1b4c 0%, #1a2d6e 60%, #162558 100%);
  display: flex; flex-direction: column;
  z-index: 1000; transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}
.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
  box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.3px; }
.brand-sub { color: rgba(255,255,255,0.5); font-size: 10px; letter-spacing: 0.5px; }
.sidebar-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; font-size: 16px; display: none;
}
.role-switcher {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.role-label { color: rgba(255,255,255,0.45); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.role-select {
  width: 100%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 8px; padding: 7px 10px;
  font-size: 12.5px; cursor: pointer; font-family: 'Inter', sans-serif;
}
.role-select option { background: #1a2d6e; color: #fff; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.nav-section-label {
  color: rgba(255,255,255,0.35); font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 12px 20px 5px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  border-radius: 0; transition: all 0.2s;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,107,53,0.25), rgba(255,107,53,0.05));
  color: #ff8c5a; border-left: 3px solid #ff6b35;
}
.badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; min-width: 20px; text-align: center;
}
.badge-warning { background: #f59e0b; color: #fff; }
.badge-danger { background: #ef4444; color: #fff; }
.badge-primary { background: #3b82f6; color: #fff; }
.badge-info { background: #06b6d4; color: #fff; }
.badge-success { background: #10b981; color: #fff; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sync-status { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.45); font-size: 11px; }
.sync-status i { color: #10b981; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left 0.3s ease;
}
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid #e8eaed;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.menu-btn {
  display: none; background: none; border: none;
  font-size: 20px; color: #666; cursor: pointer; padding: 4px;
}
.page-title { font-size: 18px; font-weight: 700; color: #1a1d2e; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #f5f6fa; border: 1px solid #e8eaed;
  border-radius: 10px; padding: 7px 14px;
}
.search-wrap i { color: #999; font-size: 13px; }
.search-wrap input {
  border: none; background: none; outline: none;
  font-size: 13px; color: #333; width: 180px; font-family: 'Inter', sans-serif;
}
.notif-btn {
  position: relative; background: none; border: 1px solid #e8eaed;
  border-radius: 10px; width: 38px; height: 38px;
  cursor: pointer; color: #666; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.notif-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; background: #ef4444;
  border-radius: 50%; border: 1px solid #fff;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: #f5f6fa; border: 1px solid #e8eaed;
  border-radius: 10px; padding: 6px 12px; cursor: pointer;
}
.user-avatar { font-size: 16px; }
.user-name { font-size: 13px; font-weight: 600; color: #333; }

/* ===== MODULE CONTAINER ===== */
.module-container { flex: 1; padding: 24px; overflow-y: auto; }

/* ===== DASHBOARD ===== */
.dashboard-header { margin-bottom: 24px; }
.dashboard-header h2 { font-size: 22px; font-weight: 800; color: #1a1d2e; }
.dashboard-header p { color: #6b7280; font-size: 14px; margin-top: 3px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.kpi-card {
  background: #fff; border-radius: 14px;
  padding: 20px; position: relative; overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.kpi-value { font-size: 26px; font-weight: 800; color: #1a1d2e; line-height: 1; }
.kpi-label { color: #6b7280; font-size: 12px; font-weight: 500; margin-top: 5px; }
.kpi-change { font-size: 11px; margin-top: 6px; font-weight: 600; }
.kpi-change.up { color: #10b981; }
.kpi-change.down { color: #ef4444; }

.kpi-blue .kpi-icon { background: #eff6ff; color: #3b82f6; }
.kpi-green .kpi-icon { background: #ecfdf5; color: #10b981; }
.kpi-orange .kpi-icon { background: #fff7ed; color: #f97316; }
.kpi-red .kpi-icon { background: #fef2f2; color: #ef4444; }
.kpi-purple .kpi-icon { background: #f5f3ff; color: #8b5cf6; }
.kpi-teal .kpi-icon { background: #f0fdfa; color: #14b8a6; }

.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;
}

.dash-section {
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05); overflow: hidden;
}
.dash-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex; align-items: center; justify-content: space-between;
}
.dash-section-header h3 { font-size: 14px; font-weight: 700; color: #1a1d2e; }
.dash-section-header a { font-size: 12px; color: #3b82f6; text-decoration: none; cursor: pointer; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  padding: 8px 14px; font-size: 11px; font-weight: 600;
  color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid #f3f4f6; text-align: left;
}
.dash-table td {
  padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #f9fafb;
  color: #374151; vertical-align: middle;
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: #f9fafb; }

/* ===== STATUS BADGES ===== */
.status-pill {
  display: inline-block; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.s-new { background: #eff6ff; color: #3b82f6; }
.s-contacted { background: #f0fdf4; color: #16a34a; }
.s-site { background: #fef9c3; color: #ca8a04; }
.s-won { background: #dcfce7; color: #15803d; }
.s-lost { background: #fef2f2; color: #dc2626; }
.s-negotiation { background: #fdf4ff; color: #9333ea; }
.s-quotation { background: #fff7ed; color: #ea580c; }
.s-progress { background: #dbeafe; color: #1d4ed8; }
.s-completed { background: #dcfce7; color: #15803d; }
.s-overdue { background: #fef2f2; color: #dc2626; }
.s-partial { background: #fff7ed; color: #c2410c; }
.s-paid { background: #dcfce7; color: #15803d; }
.s-onsite { background: #dbeafe; color: #1d4ed8; }
.s-punch { background: #fef9c3; color: #b45309; }
.s-open { background: #fef2f2; color: #dc2626; }
.s-resolved { background: #dcfce7; color: #15803d; }
.s-pending { background: #fff7ed; color: #c2410c; }
.s-draft { background: #f3f4f6; color: #6b7280; }
.s-high { background: #fef2f2; color: #dc2626; }
.s-normal { background: #eff6ff; color: #3b82f6; }
.s-low { background: #f3f4f6; color: #6b7280; }
.s-survey { background: #f0fdf4; color: #15803d; }
.s-assigned { background: #eff6ff; color: #1d4ed8; }
.s-sent { background: #f0fdf4; color: #166534; }
.s-hold { background: #fef9c3; color: #b45309; }
.s-cold { background: #f3f4f6; color: #6b7280; }

/* ===== MODULE HEADER ===== */
.module-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.module-header h2 { font-size: 20px; font-weight: 800; color: #1a1d2e; }
.module-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 9px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
  font-family: 'Inter', sans-serif; transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.35); }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline {
  background: #fff; color: #374151; border: 1px solid #d1d5db;
}
.btn-outline:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px 10px; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; }

/* ===== FILTER ROW ===== */
.filter-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; padding: 12px 16px; border-radius: 12px;
  border: 1px solid #e8eaed; margin-bottom: 16px; flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.filter-row input, .filter-row select {
  border: 1px solid #e8eaed; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; color: #374151;
  font-family: 'Inter', sans-serif; outline: none;
  background: #f9fafb;
}
.filter-row input:focus, .filter-row select:focus { border-color: #3b82f6; background: #fff; }
.filter-row input { min-width: 200px; }
.filter-row label { font-size: 12px; color: #6b7280; font-weight: 500; }

/* ===== CARD LIST ===== */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.crm-card {
  background: #fff; border-radius: 12px;
  border: 1px solid #e8eaed;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  padding: 16px 20px; cursor: pointer;
  transition: all 0.2s;
}
.crm-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #3b82f6; transform: translateY(-1px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-title { font-size: 15px; font-weight: 700; color: #1a1d2e; }
.card-sub { font-size: 12.5px; color: #6b7280; margin-top: 2px; }
.card-meta { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.card-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #6b7280; }
.card-meta-item i { font-size: 11px; color: #9ca3af; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f3f4f6; }

/* ===== TABLE ===== */
.table-wrap {
  background: #fff; border-radius: 12px;
  border: 1px solid #e8eaed;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  overflow: hidden;
}
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table th {
  background: #f8fafc; padding: 12px 16px;
  font-size: 11.5px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid #e8eaed; text-align: left;
  white-space: nowrap;
}
.crm-table td {
  padding: 12px 16px; font-size: 13px; color: #374151;
  border-bottom: 1px solid #f3f4f6; vertical-align: middle;
}
.crm-table tr:last-child td { border-bottom: none; }
.crm-table tbody tr { cursor: pointer; transition: background 0.15s; }
.crm-table tbody tr:hover td { background: #f8fafc; }
.crm-table .actions { display: flex; gap: 6px; }
.amount { font-weight: 700; color: #1a1d2e; font-variant-numeric: tabular-nums; }
.overdue-row td { background: #fff9f9 !important; }
.overdue-row td:first-child { border-left: 3px solid #ef4444; }

/* ===== FORM ===== */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12.5px; font-weight: 600; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid #d1d5db; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: #1a1d2e;
  font-family: 'Inter', sans-serif; outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-divider { grid-column: 1 / -1; border: none; border-top: 1px solid #f3f4f6; margin: 4px 0; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 680px;
  max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f3f4f6; background: #fafafa;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: #1a1d2e; }
.modal-close { background: none; border: none; font-size: 18px; color: #9ca3af; cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: #f3f4f6; color: #374151; }
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #f3f4f6;
  display: flex; justify-content: flex-end; gap: 10px;
  background: #fafafa;
}

/* ===== DETAIL VIEW ===== */
.detail-section { margin-bottom: 20px; }
.detail-section-title {
  font-size: 11px; font-weight: 700; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item { }
.detail-item .dl { font-size: 11.5px; color: #9ca3af; font-weight: 500; margin-bottom: 2px; }
.detail-item .dv { font-size: 13px; color: #1a1d2e; font-weight: 600; word-break: break-word; }
.detail-item.full { grid-column: 1 / -1; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 24px; color: #9ca3af;
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; color: #6b7280; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===== PIPELINE ===== */
.pipeline-wrap { overflow-x: auto; padding-bottom: 12px; }
.pipeline-board { display: flex; gap: 14px; min-width: 900px; }
.pipeline-col {
  flex: 1; min-width: 165px; background: #f8fafc;
  border-radius: 12px; border: 1px solid #e8eaed; overflow: hidden;
}
.pipeline-col-header {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid transparent;
}
.pipeline-col-header .col-title { font-size: 12.5px; font-weight: 700; }
.pipeline-col-header .col-count { font-size: 11px; color: #6b7280; font-weight: 600; }
.pipeline-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.pipeline-card {
  background: #fff; border-radius: 9px; padding: 10px 12px;
  border: 1px solid #e8eaed; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05); transition: all 0.15s;
}
.pipeline-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.pc-name { font-size: 12.5px; font-weight: 700; color: #1a1d2e; margin-bottom: 3px; }
.pc-area { font-size: 11px; color: #6b7280; margin-bottom: 5px; }
.pc-amount { font-size: 11px; font-weight: 700; color: #1d4ed8; }

/* ===== TABS ===== */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: #f3f4f6; padding: 4px; border-radius: 10px;
  overflow-x: auto; white-space: nowrap;
}
.tab-btn {
  padding: 8px 18px; border: none; background: none;
  border-radius: 7px; font-size: 13px; font-weight: 600;
  color: #6b7280; cursor: pointer; transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.tab-btn.active { background: #fff; color: #3b82f6; box-shadow: 0 1px 6px rgba(0,0,0,0.1); }
.tab-btn:hover:not(.active) { color: #374151; }

/* ===== NOTIFICATIONS LOG ===== */
.notif-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid #f3f4f6; cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: #f9fafb; }
.notif-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.ni-whatsapp { background: #dcfce7; color: #16a34a; }
.ni-app { background: #dbeafe; color: #1d4ed8; }
.ni-email { background: #fdf4ff; color: #9333ea; }
.notif-content { flex: 1; }
.notif-subject { font-size: 13.5px; font-weight: 600; color: #1a1d2e; }
.notif-meta { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }
.notif-time { font-size: 11px; color: #9ca3af; white-space: nowrap; }

/* ===== PROGRESS BAR ===== */
.progress-wrap { background: #f3f4f6; border-radius: 6px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.pb-green { background: #10b981; }
.pb-blue { background: #3b82f6; }
.pb-orange { background: #f97316; }

/* ===== ALERT BANNER ===== */
.alert-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 13px;
}
.ab-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.ab-danger { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.ab-success { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.ab-info { background: #eff6ff; border: 1px solid #93c5fd; color: #1e3a8a; }
.alert-banner i { font-size: 16px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: #1a1d2e; color: #fff;
  padding: 13px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: toastIn 0.3s ease; min-width: 280px;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.warning { background: #d97706; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ===== CHARTS PLACEHOLDER ===== */
.chart-placeholder {
  background: #f8fafc; border-radius: 10px;
  border: 2px dashed #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 13px; padding: 30px;
}

/* ===== WHATSAPP BUTTON ===== */
.wa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: #25d366; color: #fff;
  border-radius: 8px; font-size: 12px; font-weight: 600;
  border: none; cursor: pointer; transition: background 0.2s;
}
.wa-btn:hover { background: #1da851; }

/* ===== ENGINEER TILE ===== */
.engineer-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px;
}
.eng-tile {
  background: #fff; border-radius: 12px; padding: 16px;
  border: 1px solid #e8eaed; box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  text-align: center;
}
.eng-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 10px;
  border: 2px solid #e8eaed;
}
.eng-name { font-size: 14px; font-weight: 700; color: #1a1d2e; }
.eng-jobs { font-size: 12px; color: #6b7280; margin-top: 3px; }
.eng-status { margin-top: 8px; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex !important; }
  .overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .menu-btn { display: flex !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .form-group.full { grid-column: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .search-wrap input { width: 120px; }
  .module-container { padding: 16px; }
  .crm-table th, .crm-table td { padding: 10px 10px; font-size: 12px; }
  .dashboard-header h2 { font-size: 18px; }
  .user-name { display: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
  .pipeline-board { min-width: 100%; flex-direction: column; }
  .crm-table { display: block; overflow-x: auto; }
}

/* ===== TALLY SYNC BADGE ===== */
.tally-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.tally-badge i { font-size: 10px; }

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.qa-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 10px; background: #fff;
  border: 1px solid #e8eaed; border-radius: 12px;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.qa-btn:hover { border-color: #3b82f6; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.qa-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.qa-label { font-size: 12px; font-weight: 600; color: #374151; text-align: center; line-height: 1.3; }

/* ===== LOADING ===== */
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: #9ca3af; font-size: 14px; gap: 10px;
}
.spinner {
  width: 22px; height: 22px; border: 2px solid #e5e7eb;
  border-top-color: #3b82f6; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================================
   TALLY PRIME IMPORT MODULE — Full CSS
   ======================================================== */

/* Stepper */
.ti-stepper {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px; flex-wrap: wrap;
}
.ti-step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 30px;
  background: #f3f4f6; color: #9ca3af;
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  transition: all 0.25s;
}
.ti-step.active {
  background: #eff6ff; color: #1d4ed8;
  border: 1.5px solid #93c5fd;
}
.ti-step.done {
  background: #dcfce7; color: #15803d;
  border: 1.5px solid #86efac;
}
.ti-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: currentColor; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.ti-step.active .ti-step-num { background: #2563eb; color: #fff; }
.ti-step.done .ti-step-num { background: #16a34a; color: #fff; }
.ti-step-label { font-size: 12px; }
.ti-step-line {
  flex: 1; min-width: 20px; max-width: 50px;
  height: 2px; background: #e5e7eb; margin: 0 4px;
}
.ti-step-line.active { background: #86efac; }

/* Section card */
.ti-card {
  background: #fff; border-radius: 14px;
  border: 1px solid #e8eaed;
  padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ti-section-title {
  font-size: 14px; font-weight: 700; color: #1a1d2e;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}

/* Instructions */
.ti-instructions { display: flex; flex-direction: column; gap: 10px; }
.ti-inst-step {
  display: flex; gap: 12px; align-items: flex-start;
}
.ti-inst-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; flex-shrink: 0; margin-top: 1px;
}
.ti-inst-text { font-size: 13px; color: #374151; line-height: 1.55; }

/* Upload zone */
.ti-upload-zone {
  border: 2px dashed #c7d2fe; border-radius: 14px;
  padding: 40px 24px; text-align: center;
  cursor: pointer; transition: all 0.2s;
  background: #f8faff;
}
.ti-upload-zone:hover, .ti-upload-zone.dragover {
  border-color: #6366f1; background: #eef2ff;
}
.ti-upload-icon { font-size: 44px; margin-bottom: 12px; }
.ti-upload-title { font-size: 16px; font-weight: 700; color: #1a1d2e; margin-bottom: 6px; }
.ti-upload-sub { font-size: 13px; color: #6b7280; margin-bottom: 18px; }
.ti-file-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 10px;
  background: #3b82f6; color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'Inter',sans-serif;
  transition: all 0.2s;
}
.ti-file-btn:hover { background: #2563eb; transform: translateY(-1px); }

/* Column mapping grid */
.ti-map-grid { display: flex; flex-direction: column; gap: 12px; }
.ti-map-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr 120px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e8eaed;
}
.ti-map-crm-name { font-size: 13px; font-weight: 600; color: #1a1d2e; }
.ti-map-crm-key {
  font-size: 11px; color: #6b7280;
  font-family: 'Courier New', monospace; margin-top: 2px;
}
.ti-map-arrow { text-align: center; color: #9ca3af; font-size: 13px; }
.ti-select {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1.5px solid #d1d5db; font-size: 12.5px;
  color: #1a1d2e; background: #fff;
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: border-color 0.2s;
}
.ti-select:focus { outline: none; border-color: #3b82f6; }
.ti-preview-val {
  font-size: 11px; color: #059669; font-weight: 600;
  background: #dcfce7; padding: 3px 8px; border-radius: 5px;
  max-width: 110px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  display: inline-block;
}

/* Preview table row highlight for duplicates */
.ti-dup-row td { opacity: 0.55; text-decoration: line-through; }
tr.duplicate td { opacity: 0.5; }

/* Alert banners — additional variants */
.ab-success {
  background: #dcfce7; border-color: #86efac; color: #166534;
}
.ab-info {
  background: #dbeafe; border-color: #93c5fd; color: #1e40af;
}

/* Responsive map grid */
@media (max-width: 640px) {
  .ti-map-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .ti-map-arrow { display: none; }
  .ti-stepper { gap: 4px; }
  .ti-step-label { display: none; }
  .ti-step-line { min-width: 10px; }
}

/* code tags in tables */
code {
  background: #f3f4f6; padding: 2px 6px;
  border-radius: 4px; font-size: 11.5px;
  font-family: 'Courier New', monospace; color: #374151;
}
