/* ============================================
   boondoors Lead Tracker — Global Stylesheet
   ============================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #F8F4F4; color: #111; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Form Controls ── */
.form-input { width: 100%; border: 1px solid #E8BCBC; border-radius: 6px; padding: 8px 11px; font-size: 13px; background: #fff; color: #111; outline: none; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; }
.form-input:focus { border-color: #8B1A1A; box-shadow: 0 0 0 3px rgba(139,26,26,0.08); }
.form-label { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: #6B6B6B; margin-bottom: 4px; letter-spacing: 0.06em; text-transform: uppercase; }
.form-label i { font-size: 11px; }
.form-group { margin-bottom: 12px; }
.form-section-title { font-size: 10px; font-weight: 700; color: #8B1A1A; letter-spacing: 0.1em; text-transform: uppercase; margin: 14px 0 8px; display: flex; align-items: center; gap: 6px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.form-grid-2 .full-col { grid-column: 1 / -1; }

/* ── Input with icon ── */
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #6B6B6B; pointer-events: none; }
.input-icon-wrap .form-input { padding-left: 32px; }
.pass-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #6B6B6B; font-size: 15px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 8px 18px; cursor: pointer; border: none; font-family: inherit; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #8B1A1A; color: #fff; box-shadow: 0 2px 8px rgba(139,26,26,0.35); }
.btn-primary:hover { background: #7A1515; }
.btn-ghost { background: transparent; color: #2D2D2D; border: 1px solid #E8BCBC; }
.btn-ghost:hover { background: #F8F4F4; }
.btn-outline { background: #fff; color: #8B1A1A; border: 1px solid #8B1A1A; }
.btn-outline:hover { background: #FFF5F5; }
.btn-nav { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.25); font-size: 12px; padding: 5px 12px; }
.btn-nav:hover { background: rgba(255,255,255,0.25); }
.btn-sm { font-size: 11px; padding: 5px 12px; }
.btn-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.ms-auto { margin-left: auto; }

/* ── Alerts ── */
.alert { display: flex; align-items: center; gap: 6px; border-radius: 6px; padding: 9px 12px; font-size: 12px; margin-bottom: 14px; }
.alert-error { background: #FFF0F0; border: 1px solid #FFCDD2; color: #B71C1C; }

/* ── Toast ── */
.toast { display: none; position: fixed; bottom: 20px; right: 16px; left: 16px; z-index: 9999; border-radius: 10px; padding: 12px 16px; font-size: 13px; font-weight: 500; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.25); align-items: center; gap: 10px; animation: slideIn 0.25s ease; max-width: 400px; }
@media (min-width: 500px) { .toast { left: auto; right: 24px; bottom: 24px; } }

/* ─────────────────────────────────────────
   AUTH PAGES
───────────────────────────────────────── */
.auth-body { background: linear-gradient(135deg,#2D0000 0%,#5C0000 50%,#8B1A1A 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px 12px; }
.auth-wrap { width: 100%; max-width: 430px; }
.auth-logo-wrap { text-align: center; margin-bottom: 24px; }
.auth-logo-box { width: 74px; height: 74px; border-radius: 18px; background: #fff; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 28px rgba(0,0,0,0.35); }
.auth-logo-img { width: 58px; height: 58px; object-fit: cover; border-radius: 12px; }
.auth-brand { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.auth-brand-sub { font-size: 11px; color: rgba(255,255,255,0.55); letter-spacing: 0.12em; margin-top: 4px; }
.auth-card { background: #fff; border-radius: 16px; padding: 26px 26px 22px; box-shadow: 0 10px 44px rgba(0,0,0,0.32); }
.auth-card-title { font-size: 13px; font-weight: 600; color: #2D2D2D; margin-bottom: 16px; text-align: center; }
.auth-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #E8BCBC; }
.auth-card-header-icon { width: 36px; height: 36px; border-radius: 9px; background: #FFF5F5; display: flex; align-items: center; justify-content: center; color: #8B1A1A; font-size: 18px; flex-shrink: 0; }
.auth-card-header-title { font-size: 14px; font-weight: 700; color: #111; }
.auth-card-header-sub { font-size: 11px; color: #6B6B6B; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #E8BCBC; }
.auth-divider span { font-size: 11px; color: #6B6B6B; font-weight: 500; }
.auth-secure-note { margin-top: 16px; text-align: center; font-size: 11px; color: #6B6B6B; display: flex; align-items: center; justify-content: center; gap: 4px; }
.auth-hint { text-align: center; margin-top: 12px; font-size: 11px; color: rgba(255,255,255,0.3); }

/* Login option buttons */
.login-option { display: flex; align-items: center; gap: 14px; width: 100%; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: all 0.15s; }
.otp-option { background: #8B1A1A; color: #fff; border: none; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(139,26,26,0.4); }
.otp-option:hover { background: #7A1515; transform: translateY(-1px); }
.pass-option { background: #fff; border: 1.5px solid #8B1A1A; }
.pass-option:hover { background: #FFF5F5; }
.login-option-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 22px; }
.pass-icon { background: #FFF5F5; color: #8B1A1A; }
.login-option-text { flex: 1; text-align: left; }
.login-option-title { font-size: 14px; font-weight: 700; color: #fff; }
.pass-title { color: #8B1A1A; }
.login-option-sub { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.pass-option .login-option-sub { color: #6B6B6B; }
.login-option-arrow { font-size: 18px; margin-left: auto; }

/* OTP boxes */
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.otp-box { width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 8px; border: 2px solid #E8BCBC; color: #111; outline: none; transition: border-color 0.15s; }
.otp-box:focus { border-color: #8B1A1A; box-shadow: 0 0 0 3px rgba(139,26,26,0.1); }

/* OTP sent banner */
.otp-sent-banner { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.otp-sent-icon { width: 36px; height: 36px; background: #EA4335; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-size: 18px; }
.otp-sent-title { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.95); }
.otp-sent-sub { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.otp-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ─────────────────────────────────────────
   DASHBOARD
───────────────────────────────────────── */
.dash-nav { background: #8B1A1A; color: #fff; padding: 0 16px; display: flex; align-items: center; gap: 10px; min-height: 54px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 100; flex-wrap: wrap; }
.nav-logo { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; border: 1.5px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.nav-brand { line-height: 1.2; }
.nav-brand-name { font-size: 13px; font-weight: 700; }
.nav-brand-sub { font-size: 9px; letter-spacing: 0.1em; opacity: 0.65; }
.nav-tabs { display: flex; gap: 2px; margin-left: 14px; }
.nav-tab { display: flex; align-items: center; gap: 5px; background: transparent; color: #fff; border: none; border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 400; cursor: pointer; transition: background 0.15s; opacity: 0.8; }
.nav-tab:hover, .nav-tab.active { background: rgba(255,255,255,0.2); opacity: 1; font-weight: 700; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.nav-user-name { font-size: 12px; font-weight: 600; line-height: 1.1; }
.nav-user-role { font-size: 9px; opacity: 0.65; letter-spacing: 0.06em; text-transform: uppercase; }
.report-status { background: rgba(0,0,0,0.25); border-radius: 20px; padding: 3px 10px; font-size: 10px; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 5px; }

.dash-content { padding: 16px 20px; }
.page-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #8B1A1A; }
.page-heading-title { font-size: 17px; font-weight: 700; color: #111; }
.page-heading-sub { font-size: 10px; color: #6B6B6B; margin-top: 2px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 8px; padding: 10px 14px; border: 1px solid #E8BCBC; border-left-width: 3px; }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-label { font-size: 10.5px; color: #6B6B6B; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
.stat-val { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 2px; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1 1 200px; }
.search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 13px; color: #6B6B6B; pointer-events: none; }
.search-input { padding-left: 30px !important; }
.filter-wrap { position: relative; }
.filter-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 13px; color: #6B6B6B; pointer-events: none; }
.filter-select { padding-left: 28px !important; min-width: 145px; }
.lead-count { font-size: 11px; color: #6B6B6B; display: flex; align-items: center; gap: 4px; white-space: nowrap; }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1.5px solid #8B1A1A; border-radius: 10px; box-shadow: 0 2px 8px rgba(139,26,26,0.10); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; min-width: 900px; }
.table-head th { padding: 9px 8px; text-align: left; font-weight: 700; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.04em; border-right: 1px solid rgba(255,255,255,0.22); border-bottom: 2px solid #5C0000; background: #8B1A1A; color: #fff; }
.table-row { cursor: pointer; border-bottom: 1px solid #DDBEBE; transition: background 0.1s; }
.table-row:hover { background: #FFF2F2; }
.table-row td { padding: 7px 8px; border-right: 1px solid #DDBEBE; border-bottom: 1px solid #DDBEBE; }
.td-num { color: #8B1A1A; font-weight: 700; text-align: center; background: #FDF8F8; }
.td-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-email { color: #8B1A1A; font-size: 11px; }
.td-muted { color: #6B6B6B; font-size: 11px; }
.table-empty { padding: 3rem; text-align: center; color: #6B6B6B; font-size: 13px; }
.del-btn { background: none; border: none; color: #6B6B6B; cursor: pointer; font-size: 15px; opacity: 0.3; transition: opacity 0.15s; padding: 2px; }
.table-row:hover .del-btn { opacity: 1; color: #8B1A1A; }

/* Modals */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; padding: 16px; animation: fadeIn 0.2s ease; }
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-height: 93vh; overflow-y: auto; box-shadow: 0 12px 50px rgba(0,0,0,0.28); }
.modal-header { background: #8B1A1A; border-radius: 12px 12px 0 0; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.modal-title { font-weight: 700; font-size: 15px; color: #fff; display: flex; align-items: center; gap: 8px; }
.modal-close-btn { background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.3); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-size: 15px; transition: background 0.15s; }
.modal-close-btn:hover { background: rgba(255,255,255,0.32); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #E8BCBC; padding-top: 14px; margin-top: 8px; }

/* Lead Detail */
.detail-body { overflow-y: auto; flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.detail-info-card { background: #fff; border-radius: 10px; border: 1px solid #E8BCBC; padding: 14px 16px; }
.info-section-title { font-size: 10.5px; font-weight: 700; color: #8B1A1A; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.info-item { display: flex; align-items: flex-start; gap: 8px; }
.info-icon { width: 26px; height: 26px; border-radius: 6px; background: #FFF5F5; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #8B1A1A; font-size: 12px; margin-top: 2px; }
.info-label { font-size: 9.5px; color: #6B6B6B; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.info-val { font-size: 12px; color: #111; font-weight: 500; margin-top: 2px; word-break: break-word; }

/* Comments */
.comment-section { background: #fff; border-radius: 10px; border: 1px solid #E8BCBC; padding: 14px 16px; }
.comment-section-title { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; font-weight: 700; color: #8B1A1A; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.comment-count-badge { font-size: 10px; font-weight: 400; color: #6B6B6B; text-transform: none; letter-spacing: 0; }
.comments-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.no-comments { text-align: center; padding: 20px 0; color: #6B6B6B; font-size: 12px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.comment-avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.comment-header { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-author { font-size: 12px; font-weight: 700; color: #111; }
.role-badge { font-size: 9px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.role-badge.admin { background: #8B1A1A; color: #fff; }
.role-badge.user { background: #1565C0; color: #fff; }
.comment-time { font-size: 10px; color: #6B6B6B; display: flex; align-items: center; gap: 3px; }
.comment-bubble { background: #F8F8F8; border-radius: 4px 10px 10px 10px; padding: 9px 13px; font-size: 12.5px; color: #2D2D2D; line-height: 1.65; border: 1px solid #E8BCBC; }
.add-comment-wrap { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid #E8BCBC; padding-top: 12px; }
.comment-input-wrap { flex: 1; position: relative; }
.comment-textarea { width: 100%; border: 1.5px solid #E8BCBC; border-radius: 8px; padding: 9px 44px 9px 12px; font-size: 13px; resize: none; color: #111; outline: none; font-family: inherit; transition: border-color 0.15s; line-height: 1.5; }
.comment-textarea:focus { border-color: #8B1A1A; }
.comment-send-btn { position: absolute; right: 8px; bottom: 8px; background: #8B1A1A; border: none; border-radius: 6px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-size: 14px; transition: background 0.15s; }
.comment-send-btn:disabled { background: #E0E0E0; cursor: default; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E8BCBC; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #8B1A1A; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-tabs .nav-tab span { display: none; }
  .nav-user-info { display: none; }
  .btn-text { display: none; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .dash-content { padding: 10px 12px; }
  .modal-overlay.active { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 16px 16px 0 0; max-height: 96vh; }
  .info-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-2 .full-col { grid-column: 1; }
  .otp-box { width: 38px; height: 46px; font-size: 18px; }
  .auth-card { padding: 20px 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-wrap { flex: 1 1 auto; }
  .ms-auto { margin-left: 0; }
}
