/* ============================================
   BUNTYTECH ADMIN PANEL STYLESHEET
   ============================================ */

:root {
  --primary: #7B9669;
  --primary-dark: #404E3B;
  --primary-light: rgba(123,150,105,0.12);
  --sidebar: #2d3b2d;
  --sidebar-hover: #3a4d3a;
  --bg: #f0f2f5;
  --bg-light: #f8f9fa;
  --bg-secondary: #f3f4f6;
  --card: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-dark: #111827;
  --text-muted: #6c757d;
  --border: #e0e0e0;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --font: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* ---- Login Page ---- */
.login-body { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--card); border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo img { width: 60px; height: 60px; margin-bottom: 10px; }
.login-logo h2 { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: var(--primary-dark); letter-spacing: 2px; }
.login-logo p { font-size: 13px; color: var(--text-muted); }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.login-form input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: all 0.3s; outline: none; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123,150,105,0.1); }
.login-form button { width: 100%; padding: 14px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.login-form button:hover { background: var(--primary-dark); }

/* ---- Admin Layout ---- */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 260px; background: var(--sidebar); color: #fff; position: fixed; left: 0; top: 0; bottom: 0; display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s; }
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; }
.sidebar-header img { width: 36px; height: 36px; }
.sidebar-header span { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 2px; }
.sidebar-menu { padding: 16px 0; flex: 1; overflow-y: auto; }
.sidebar-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.7); font-size: 14px; transition: all 0.3s; border-left: 3px solid transparent; }
.sidebar-menu a:hover, .sidebar-menu a.active { background: var(--sidebar-hover); color: #fff; border-left-color: var(--primary); }
.sidebar-menu i { width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); flex-shrink: 0; }
.sidebar-footer a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.6); font-size: 13px; }
.sidebar-footer a:hover { color: #fff; }

/* Main Content */
.main-content { flex: 1; margin-left: 260px; min-height: 100vh; }
.admin-header { background: var(--card); padding: 16px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 99; }
.header-title h1 { font-size: 20px; font-weight: 600; }
.header-title p { font-size: 12px; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions a { width: 38px; height: 38px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; transition: all 0.3s; }
.header-actions a:hover { background: var(--primary); color: #fff; }
.user-badge { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: var(--bg); border-radius: 8px; }
.user-badge i { font-size: 18px; color: var(--primary); }
.user-badge span { font-size: 13px; font-weight: 500; }

/* Content Area */
.content-area { padding: 30px; }

/* Stats Cards */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-icon.blue { background: rgba(23,162,184,0.1); color: var(--info); }
.stat-icon.green { background: rgba(40,167,69,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(255,193,7,0.1); color: #e6a700; }
.stat-icon.red { background: rgba(220,53,69,0.1); color: var(--danger); }
.stat-info h3 { font-family: var(--font-mono); font-size: 24px; font-weight: 600; }
.stat-info p { font-size: 12px; color: var(--text-muted); }

/* Cards */
.card { background: var(--card); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 24px; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.admin-table tr:hover { background: rgba(123,150,105,0.03); }
.admin-table img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 500; }
.badge-success { background: rgba(40,167,69,0.1); color: var(--success); }
.badge-warning { background: rgba(255,193,7,0.1); color: #856404; }
.badge-danger { background: rgba(220,53,69,0.1); color: var(--danger); }
.badge-info { background: rgba(23,162,184,0.1); color: var(--info); }

/* Buttons */
.btn-sm { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 12px; font-weight: 500; border-radius: 6px; border: none; cursor: pointer; transition: all 0.3s; }
.btn-edit { background: rgba(23,162,184,0.1); color: var(--info); }
.btn-edit:hover { background: var(--info); color: #fff; }
.btn-delete { background: rgba(220,53,69,0.1); color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: #fff; }
.btn-view { background: rgba(123,150,105,0.1); color: var(--primary); }
.btn-view:hover { background: var(--primary); color: #fff; }
.btn-approve { background: rgba(40,167,69,0.1); color: var(--success); }
.btn-approve:hover { background: var(--success); color: #fff; }
.btn-reject { background: rgba(220,53,69,0.1); color: var(--danger); }
.btn-reject:hover { background: var(--danger); color: #fff; }
.btn-add { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; border-radius: 8px; border: none; cursor: pointer; transition: all 0.3s; }
.btn-add:hover { background: var(--primary-dark); }

/* Forms */
.admin-form .form-group { margin-bottom: 20px; }
.admin-form label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: all 0.3s; outline: none; font-family: var(--font); }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123,150,105,0.1); }
.admin-form textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Reply button in table */
.btn-reply-open {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: #6366f1; color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  font-size: 13px;
  transition: background 0.2s, transform 0.15s;
}
.btn-reply-open:hover { background: #4f46e5; transform: scale(1.08); }

/* ============================================
   INQUIRY EMAIL REPLY MODAL
   ============================================ */
.inq-reply-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.inq-reply-overlay.active { opacity: 1; pointer-events: all; }

.inq-reply-box {
  background: #fff;
  border-radius: 16px;
  width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  transform: scale(0.92) translateY(18px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  scrollbar-width: thin;
}
.inq-reply-overlay.active .inq-reply-box { transform: scale(1) translateY(0); }

.inq-reply-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky; top: 0; background: #fff; z-index: 2;
  border-radius: 16px 16px 0 0;
}
.inq-reply-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff; flex-shrink: 0;
}
.inq-reply-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.inq-reply-sub   { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.inq-reply-close {
  margin-left: auto; background: #f3f4f6; border: none;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #666; cursor: pointer;
  transition: background 0.2s; flex-shrink: 0;
}
.inq-reply-close:hover { background: #e5e7eb; color: #111; }

.inq-reply-form { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; }

.inq-field { display: flex; flex-direction: column; gap: 5px; }
.inq-field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.inq-field label span { color: #ef4444; }
.inq-field input,
.inq-field textarea {
  border: 1.5px solid #e5e7eb; border-radius: 9px;
  padding: 10px 13px; font-size: 13.5px; font-family: var(--font);
  color: var(--text); background: #fafafa; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box; width: 100%;
}
.inq-field input:focus, .inq-field textarea:focus {
  border-color: #6366f1; background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.inq-field textarea { resize: vertical; min-height: 160px; line-height: 1.6; }

.inq-to-display {
  padding: 9px 13px; background: #f3f4f6; border-radius: 9px;
  font-size: 13.5px; color: var(--text); font-weight: 500;
  border: 1.5px solid #e5e7eb;
}
.inq-context-box {
  background: #f8faff; border: 1.5px solid #e0e7ff;
  border-radius: 9px; padding: 10px 13px;
  font-size: 12.5px; color: #555; line-height: 1.6;
  font-style: italic; max-height: 80px; overflow-y: auto;
}
.inq-char-count { font-size: 11.5px; color: var(--text-muted); text-align: right; margin-top: 3px; }

.inq-reply-feedback {
  padding: 10px 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
}
.inq-reply-feedback.success { background: #f0fdf4; border: 1.5px solid #86efac; color: #166534; }
.inq-reply-feedback.error   { background: #fef2f2; border: 1.5px solid #fca5a5; color: #991b1b; }

.inq-reply-actions {
  display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px;
}
.inq-btn-cancel {
  background: #f3f4f6; border: none; border-radius: 9px;
  padding: 10px 20px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; color: #555; transition: background 0.2s;
  font-family: var(--font);
}
.inq-btn-cancel:hover { background: #e5e7eb; }
.inq-btn-send {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none; border-radius: 9px;
  padding: 10px 24px; font-size: 13.5px; font-weight: 700;
  color: #fff; cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.inq-btn-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
.inq-btn-send:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.inq-send-loader { display: flex; align-items: center; gap: 6px; }

@media (max-width: 640px) {
  .inq-reply-box { border-radius: 12px; }
  .inq-reply-header { padding: 14px 16px 12px; }
  .inq-reply-form { padding: 14px 16px 18px; }
}

/* Sidebar new-inquiry badge */
.sb-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  margin-left: auto;
  line-height: 1;
  animation: badgePop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  flex-shrink: 0;
}
@keyframes badgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
/* Make the Inquiries nav link flex so badge aligns right */
.sidebar-menu a { display: flex; align-items: center; gap: 10px; }
.sidebar-menu a i { flex-shrink: 0; }
.sidebar-menu a .sb-new-badge { margin-left: auto; }

/* Dashboard "New Inquiries" alert card */
.new-inq-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  animation: slideInAlert 0.4s ease both;
}
@keyframes slideInAlert {
  from { opacity:0; transform: translateY(-10px); }
  to   { opacity:1; transform: translateY(0); }
}
.new-inq-alert-icon {
  width: 40px; height: 40px;
  background: #f59e0b;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.new-inq-alert-text { flex: 1; }
.new-inq-alert-text strong { font-size: 14px; color: #92400e; display: block; margin-bottom: 2px; }
.new-inq-alert-text span { font-size: 12.5px; color: #b45309; }
.new-inq-alert-btn {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.new-inq-alert-btn:hover { background: #d97706; color: #fff; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.3s; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Mobile Toggle */
.mobile-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text); cursor: pointer; }

/* Responsive */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: block; }
}
@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-header { padding: 12px 16px; }
  .content-area { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-table { display: block; overflow-x: auto; }
}

/* Live Visitor Counter */
.live-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: livePulse 1.8s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.live-visitors-grid {
  display: grid;
  grid-template-columns: 110px 110px 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.live-big-num {
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.live-big-num span {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: #22c55e;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}
.live-today span { color: var(--primary); }
.live-big-num p { margin: 6px 0 0; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.live-devices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.live-device-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.live-device-item i { width: 16px; text-align: center; color: var(--primary); }
.live-device-item span { font-weight: 600; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.live-pages {
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
  min-height: 80px;
}
.live-page-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.live-page-row:last-child { border-bottom: none; }
.live-page-name { color: var(--text); font-weight: 500; }
.live-page-cnt {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
@media (max-width: 768px) {
  .live-visitors-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Admin Mobile Responsive ── */
@media (max-width: 768px) {
  .admin-wrapper { grid-template-columns: 1fr; }
  #sidebar { position: fixed; left: -260px; top: 0; height: 100vh; z-index: 1000; transition: left 0.3s ease; }
  #sidebar.open { left: 0; }
  .main-content { grid-column: 1; }
  .admin-header { padding: 12px 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { border-radius: 10px; }
  .card-body { padding: 16px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
  .content-area { padding: 16px; }
  .admin-header h1 { font-size: 18px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; gap: 10px; }
  .content-area { padding: 12px; }
  .card-header { padding: 14px 16px; }
  .card-body { padding: 14px; }
  .admin-header { padding: 10px 14px; }
  .admin-header h1 { font-size: 16px; }
  .btn-add { padding: 10px 18px; font-size: 13px; }
  .user-badge span { display: none; }
}
