/* =========================================================================
   app.css — SINGLE canonical design for the whole panel (client + admin).
   Every page loads this one file via shared/app_head.php.

   Theme colours (--primary-color etc.) are OVERRIDDEN at runtime by
   shared/app_head.php using values from Admin → Theme Settings, so changing
   the colour in the admin panel restyles the entire website at once.
   The defaults below are only used if no admin colour is set.
   ========================================================================= */

:root {
    --primary-color: #0056b3;
    --primary-light: #0056b31A;
    --primary-hover: #0056b3E6;
    --bg-color: #f4f6f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-color); color: var(--text-main); padding-bottom: 90px; }
.desktop-only { display: none; }

/* Header */
.app-header { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; position: sticky; top: 0; z-index: 90; border-bottom: 1px solid rgba(0,0,0,0.05); }
.app-title { font-size: 20px; font-weight: 700; color: var(--text-main); letter-spacing: -0.5px; }
.admin-badge { background: #fee2e2; color: #dc2626; padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 5px; }
.user-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary-light), #ffffff); color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.app-main { padding: 20px; animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-title { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.section-title h2 { font-size: 18px; font-weight: 600; color: #334155; }

/* Cards */
.card-list { display: flex; flex-direction: column; gap: 18px; }
.app-card { background: #ffffff; border-radius: 20px; padding: 20px; box-shadow: 0 8px 24px rgba(149, 157, 165, 0.08); border: 1px solid #f1f5f9; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.app-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(149, 157, 165, 0.15); border-color: #e2e8f0; }
.card-info { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }
.card-icon { width: 52px; height: 52px; background: var(--primary-light); color: var(--primary-color); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; transition: 0.3s; }
.app-card:hover .card-icon { transform: scale(1.05); }
.card-details { flex: 1; min-width: 0; }
.card-details h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #0f172a; }
.card-details .date { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Badges */
.card-badge { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.badge-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.badge-pending { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.badge-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Live device strip */
.device-live-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; background: #0f172a; color: #e2e8f0; padding: 14px 18px; border-radius: 16px; margin-bottom: 20px; font-size: 13px; }
.device-live-strip .live-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.device-live-strip .dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.device-live-strip .dot.on { background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,0.6); }
.device-live-strip .dot.warn { background: #eab308; }
.device-live-strip .stat { color: #94a3b8; }
.device-live-strip .stat strong { color: #f8fafc; }
.wa-meta-line { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

/* Card actions & buttons */
.card-actions { display: flex; gap: 12px; border-top: 1px dashed #e2e8f0; padding-top: 15px; }
.action-btn { flex: 1; text-align: center; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; transition: all 0.2s; }
.view-btn { background: #f0f9ff; color: #0284c7; }
.view-btn:hover { background: #e0f2fe; }
.del-btn { background: #fef2f2; color: #dc2626; flex: 0.25; }
.del-btn:hover { background: #fee2e2; }
.app-btn-primary { width: 100%; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; padding: 16px; border: none; border-radius: 14px; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: 0 8px 20px var(--primary-light); transition: all 0.3s; }
.app-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px var(--primary-light); }
.app-btn-primary:active { transform: translateY(1px) scale(0.98); }

/* Forms */
.form-control { width: 100%; padding: 15px; border: 2px solid #e2e8f0; border-radius: 14px; font-size: 14px; outline: none; background: #f8fafc; transition: all 0.3s; color: #334155; }
.form-control:focus { border-color: var(--primary-color); background: #ffffff; box-shadow: 0 0 0 4px var(--primary-light); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 8px; }

/* API code box */
.api-code-box { background: #0f172a; color: #a3e635; padding: 25px 20px 20px 20px; border-radius: 14px; font-family: monospace; font-size: 12px; overflow-x: auto; white-space: nowrap; position: relative; margin-bottom: 25px; border-left: 4px solid var(--primary-color); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.api-label { position: absolute; top: 0; left: 15px; background: var(--primary-color); color: white; padding: 3px 10px; font-size: 10px; border-radius: 0 0 8px 8px; font-weight: 600; }

/* Welcome banner */
.welcome-alert { background: linear-gradient(135deg, var(--primary-color), #0f766e); color: white; padding: 25px 20px; border-radius: 20px; margin-bottom: 25px; box-shadow: 0 10px 30px var(--primary-light); position: relative; overflow: hidden; }
.welcome-alert::after { content: ''; position: absolute; top: -50%; right: -20%; width: 200px; height: 200px; background: rgba(255,255,255,0.1); border-radius: 50%; transform: rotate(45deg); }
.welcome-alert h3 { font-size: 20px; margin-bottom: 5px; font-weight: 700; position: relative; z-index: 2; }
.welcome-alert p { font-size: 14px; opacity: 0.9; position: relative; z-index: 2; }

/* Alerts (admin + client shared) */
.app-alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.app-alert.success { background: #d1fae5; color: #065f46; }
.app-alert.error { background: #fee2e2; color: #991b1b; }

/* Admin stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 30px; }
.stat-card { background: #ffffff; padding: 20px 15px; border-radius: 16px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f3f4f6; }
.stat-icon { width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: white; margin: 0 auto 10px auto; }
.stat-card h3 { font-size: 24px; font-weight: 800; color: #111827; margin-bottom: 2px; }
.stat-card p { font-size: 11px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.bg-1 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-2 { background: linear-gradient(135deg, #10b981, #059669); }
.bg-3 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-4 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* FAB */
.fab-button { position: fixed; bottom: 100px; right: 25px; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; border: none; font-size: 24px; box-shadow: 0 8px 25px var(--primary-light); cursor: pointer; z-index: 90; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.fab-button:hover { transform: scale(1.08) rotate(90deg); }

/* Bottom nav / sidebar */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); display: flex; justify-content: space-around; padding: 12px 0 20px 0; box-shadow: 0 -5px 20px rgba(0,0,0,0.04); z-index: 100; border-top: 1px solid #f1f5f9; }
.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #94a3b8; font-size: 11px; font-weight: 500; gap: 6px; cursor: pointer; transition: all 0.3s; }
.nav-item i { font-size: 20px; transition: 0.3s; }
.nav-item.active { color: var(--primary-color); }
.nav-item.active i { transform: translateY(-3px); }
.nav-item:hover { color: var(--primary-color); }

/* Bottom sheet / more menu */
.bottom-sheet-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: 0.3s ease; z-index: 1000; }
.bottom-sheet { position: fixed; bottom: -100%; left: 0; width: 100%; background: #ffffff; border-radius: 30px 30px 0 0; padding: 20px 25px 40px 25px; z-index: 1001; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 -10px 40px rgba(0,0,0,0.1); max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.bottom-sheet.active { bottom: 0; }
.bottom-sheet-overlay.active { opacity: 1; visibility: visible; }
.sheet-handle { width: 50px; height: 6px; background: #cbd5e1; border-radius: 10px; margin: 0 auto 25px auto; }
.sheet-title { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 5px; }
.more-menu { position: fixed; top: 100%; left: 0; width: 100%; height: 100vh; background: #ffffff; z-index: 1002; transition: 0.3s ease-in-out; padding: 25px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 60px; }
.more-menu.active { top: 0; }
.menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.close-menu { background: #f1f5f9; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; color: #475569; transition: 0.3s; }
.close-menu:hover { background: #e2e8f0; transform: rotate(90deg); }
.menu-links a { display: flex; align-items: center; gap: 15px; padding: 18px 15px; text-decoration: none; color: #334155; font-size: 16px; font-weight: 600; border-bottom: 1px solid #f1f5f9; border-radius: 12px; transition: 0.2s; }
.menu-links a:hover { background: #f8fafc; padding-left: 20px; }
.logout-link { color: #dc2626 !important; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.slider:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); }

/* Profile dropdown */
.profile-dropdown { position: relative; display: inline-block; cursor: pointer; }
.dropdown-content { display: none; position: absolute; right: 0; top: 50px; background-color: #ffffff; min-width: 180px; box-shadow: 0px 10px 25px rgba(0,0,0,0.1); border-radius: 14px; z-index: 100; overflow: hidden; border: 1px solid #e2e8f0; }
.dropdown-content a { color: #334155; padding: 14px 18px; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; border-bottom: 1px solid #f8fafc; transition: 0.2s; }
.dropdown-content a:hover { background-color: #f0f9ff; color: var(--primary-color); padding-left: 22px; }
.dropdown-content a.logout-text { color: #dc2626; border-bottom: none; }
.dropdown-content a.logout-text:hover { background-color: #fef2f2; color: #b91c1c; }
.profile-dropdown.active .dropdown-content { display: block; animation: fadeIn 0.2s ease-in-out; }

/* Desktop layout */
@media (min-width: 768px) {
    body { display: flex; padding-bottom: 0; }
    .page-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; }
    .bottom-nav { position: sticky; top: 0; left: 0; width: 280px; height: 100vh; flex-direction: column; justify-content: flex-start; padding: 0 0 30px 0; border-right: 1px solid #e2e8f0; background: #ffffff; overflow-y: auto; }
    .sidebar-brand { font-size: 22px; font-weight: 800; color: var(--primary-color); padding: 30px 25px; margin-bottom: 10px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 12px; }
    .nav-item { flex-direction: row; padding: 18px 25px; width: 100%; font-size: 15px; gap: 15px; justify-content: flex-start; }
    .nav-item.active { background: #f8fafc; border-right: 4px solid var(--primary-color); }
    .mobile-only { display: none !important; }
    .more-menu { display: none !important; }
    .desktop-only { display: flex; flex-direction: column; width: 100%; }
    .desktop-links-container { margin-top: 10px; border-top: 1px solid #f1f5f9; padding-top: 10px; }
    .desktop-link { display: flex; flex-direction: row; padding: 16px 25px; width: 100%; font-size: 15px; gap: 15px; justify-content: flex-start; text-decoration: none; color: #475569; font-weight: 500; transition: 0.2s; }
    .desktop-link:hover { background: #f8fafc; color: var(--primary-color); }
    .card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 25px; }
    .app-main { padding: 40px; max-width: 1400px; margin: 0 auto; width: 100%; }
    .bottom-sheet { bottom: auto; top: 50%; left: 50%; transform: translate(-50%, -40%) scale(0.9); width: 480px; border-radius: 24px; box-shadow: 0 25px 50px rgba(0,0,0,0.15); opacity: 0; visibility: hidden; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); max-height: 90vh; overflow-y: auto; }
    .bottom-sheet.active { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
    .sheet-handle { display: none; }
}

/* =========================================================================
   ADMIN / SETTINGS COMPONENTS
   (merged from the former global-style.css so admin + reseller pages share
   this one stylesheet. Shared classes above keep the unified panel look;
   these are the admin-only pieces that were missing.)
   ========================================================================= */

/* User management cards */
.user-list { display: flex; flex-direction: column; gap: 15px; }
.user-card { background: #ffffff; border-radius: 16px; padding: 18px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f3f4f6; position: relative; overflow: hidden; }
.user-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.user-avatar-placeholder { width: 45px; height: 45px; background: #f3f4f6; color: #6b7280; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-info h4 { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info p { font-size: 12px; color: #9ca3af; font-family: monospace; }
.status-dot { position: absolute; top: 18px; right: 18px; width: 10px; height: 10px; border-radius: 50%; }
.dot-active { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.dot-expired { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.dot-inactive { background: #9ca3af; box-shadow: 0 0 8px rgba(156,163,175,0.5); }
.user-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f8fafc; padding: 12px; border-radius: 10px; margin-bottom: 15px; }
.u-stat { display: flex; flex-direction: column; }
.u-stat span { font-size: 10px; color: #94a3b8; text-transform: uppercase; font-weight: 600; margin-bottom: 2px; }
.u-stat strong { font-size: 13px; color: #334155; }
.api-key-box { background: #1e293b; color: #a3e635; padding: 10px; border-radius: 8px; font-family: monospace; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings cards & forms */
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 10px; color: var(--text-main); }
.card-subtitle { font-size: 13px; color: #6b7280; margin-bottom: 25px; line-height: 1.5; }
.form-hint { display: block; margin-top: 6px; font-size: 11px; color: #9ca3af; line-height: 1.4; }
textarea.form-control { resize: vertical; }
select.form-control { appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right 15px top 50%; background-size: 12px auto; }

/* Admin sidebar submenu categories + logout state */
.menu-category { font-size: 12px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px 10px; }
.menu-links a.active { background: var(--primary-light); color: var(--primary-color); font-weight: 700; }

/* Role & feature badges */
.role-badge { font-size: 10px; padding: 3px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
.role-client { background: #e0e7ff; color: #1d4ed8; }
.role-reseller { background: #fce7f3; color: #be185d; }
.badges-row { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.badge { padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }
.badge-ai { background: #fef08a; color: #854d0e; }
.badge-sheet { background: #d1fae5; color: #065f46; }

/* Action buttons (edit/delete) */
.action-buttons { display: flex; gap: 10px; }
.btn-action { flex: 1; padding: 10px; border: none; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; text-decoration: none; }
.btn-edit { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.btn-edit:hover { background: #fef3c7; }
.btn-delete { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-delete:hover { background: #fee2e2; }

/* Reseller box */
.reseller-box { background: #fdf2f8; border: 1px solid #fbcfe8; padding: 15px; border-radius: 12px; margin-top: 15px; }
.reseller-box h4 { font-size: 13px; color: #be185d; margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }

/* Preview box (registration / plans preview) */
.preview-box { background: #f8fafc; border: 2px dashed #cbd5e1; padding: 25px; border-radius: 16px; margin-top: 35px; transition: 0.3s; }
.preview-box:hover { border-color: var(--primary-color); background: #f0fdf4; }
.preview-box h4 { margin-top: 0; color: #64748b; text-transform: uppercase; font-size: 12px; font-weight: 700; margin-bottom: 15px; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px; }
.preview-title { color: var(--primary-color); margin: 0 0 8px 0; font-size: 22px; font-weight: 800; line-height: 1.3; }
.preview-subtitle { color: #4b5563; margin-top: 0; font-size: 15px; margin-bottom: 15px; line-height: 1.6; }
.preview-list { color: #1f2937; line-height: 1.8; font-size: 14px; list-style-type: none; margin: 0; padding: 0; font-weight: 500; }
.preview-list li { margin-bottom: 6px; }

/* Theme settings rows + colour picker */
.theme-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 15px; transition: 0.3s; }
.theme-row:hover { border-color: var(--primary-color); background: #ffffff; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.theme-row label { font-size: 14px; color: #4b5563; font-weight: 600; margin: 0; cursor: pointer; flex: 1; }
.color-picker { -webkit-appearance: none; -moz-appearance: none; appearance: none; width: 50px; height: 35px; border: none; border-radius: 8px; cursor: pointer; padding: 0; background: transparent; }
.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.color-picker::-moz-color-swatch { border: none; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

@media (min-width: 768px) {
    .desktop-category { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; padding: 15px 25px 5px 25px; }
    .desktop-link i { width: 20px; text-align: center; color: #9ca3af; }
    .desktop-link.active { color: var(--primary-color); background: var(--primary-light); border-right: 4px solid var(--primary-color); }
    .desktop-link.active i { color: var(--primary-color); }
    .desktop-link.logout { color: #dc2626; margin-top: 10px; border-top: 1px solid #f3f4f6; padding-top: 20px; }
    .desktop-link.logout i { color: #dc2626; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .user-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .app-card .app-btn-primary { width: max-content; padding: 15px 40px; }
}

/* =========================================================================
   PAGE-SPECIFIC ADMIN COMPONENTS (moved out of individual pages so every
   page now links only this one stylesheet). Do not re-inline these.
   ========================================================================= */

/* ---- Affiliates (affiliates.php) ---- */
.table-responsive { width: 100%; overflow-x: auto; background: #fff; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f3f4f6; margin-bottom: 30px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; text-align: left; }
.data-table th, .data-table td { padding: 16px 20px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.data-table th { background: #f8fafc; font-weight: 600; color: #4b5563; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.data-table td { color: #111827; font-weight: 500; }
.data-table tr:hover { background: #f8fafc; }
.action-flex { display: flex; gap: 10px; }
.btn-sm { padding: 8px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: 0.2s; }
.btn-approve:hover { background: #d1fae5; }
.btn-reject:hover { background: #fee2e2; }
.u-stat strong.money { color: #059669; font-weight: 700; }
.btn-action:hover { background: #dbeafe; }
.menu-links a i { color: var(--primary-color); font-size: 18px; width: 25px; text-align: center; }
.logout-link i { color: #dc2626 !important; }
@media (min-width: 768px) {
    .desktop-link:hover i { color: var(--primary-color); }
}

/* ---- Cron Management (cron_management.php) ---- */
.info-text { font-size: 14px; color: #4b5563; line-height: 1.6; margin-bottom: 20px; }
.subtitle { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 10px; margin-top: 25px; }
.terminal-box { background: #1e293b; border-radius: 12px; padding: 20px; position: relative; margin-bottom: 25px; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); }
.terminal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.terminal-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.r { background: #ef4444; }
.dot.y { background: #f59e0b; }
.dot.g { background: #10b981; }
.copy-btn { background: rgba(255,255,255,0.1); border: none; color: #e2e8f0; font-size: 12px; font-family: 'Poppins'; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.code-content { color: #a3e635; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 1.6; word-wrap: break-word; user-select: all; }

/* ---- Email Settings (email_settings.php) ---- */
.app-btn-secondary { background: #4b5563; color: white; padding: 14px; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.guide-box { background: #fffbeb; border-left: 4px solid #f59e0b; padding: 15px 20px; border-radius: 0 12px 12px 0; margin-bottom: 25px; font-size: 13px; color: #78350f; line-height: 1.6; }
.guide-box strong { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 14px; }
.guide-box code { background: #fef3c7; color: #b45309; padding: 3px 8px; border-radius: 6px; font-family: monospace; font-weight: 600; font-size: 12px; margin-right: 3px; display: inline-block; margin-bottom: 5px; border: 1px solid #fde68a; }
@media (min-width: 768px) {
    .test-mail-wrapper { display: flex; align-items: flex-end; gap: 15px; }
    .test-mail-wrapper .form-group { margin-bottom: 0; flex: 1; }
}

/* ---- File Manager (file_manager.php) ---- */
.upload-zone { border: 2px dashed #cbd5e1; background: #f8fafc; padding: 25px 15px; border-radius: 12px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upload-zone:hover { border-color: var(--primary-color); background: #f0fdf4; }
.upload-zone i { font-size: 32px; color: #94a3b8; transition: 0.2s; }
.upload-zone:hover i { color: var(--primary-color); }
.upload-zone span { font-size: 13px; color: #64748b; font-weight: 500; }
.upload-zone .selected-file { color: var(--primary-color); font-weight: 700; display: none; }
.preview-box img { max-width: 100%; max-height: 120px; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.favicon-preview img { max-width: 64px; max-height: 64px; border: 1px solid #e5e7eb; padding: 5px; background: white; }
@media (min-width: 768px) {
    .assets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
}

/* ---- General Settings (general_settings.php) ---- */
.color-picker-row { display: flex; align-items: center; gap: 12px; background: #f8fafc; padding: 10px; border-radius: 12px; border: 1px solid #e5e7eb; }
.color-input { width: 45px; height: 45px; border: none; border-radius: 8px; cursor: pointer; background: none; flex-shrink: 0; }
.color-code { font-family: monospace; font-weight: 700; color: #334155; font-size: 14px; }
.menu-links { display: flex; flex-direction: column; gap: 8px; }

/* ---- Manage Clients (manage_clients.php) ---- */
.dot-pending { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.btn-login { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.btn-login:hover { background: #dbeafe; }
.fab-button:active { transform: scale(0.95); }
.checkbox-row { display: flex; align-items: center; gap: 10px; background: #f8fafc; padding: 12px 15px; border-radius: 12px; border: 1px solid #e5e7eb; margin-bottom: 10px; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary-color); cursor: pointer; }
.checkbox-row label { margin: 0; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; flex: 1; }

/* ---- Manage Orders (manage_orders.php) ---- */
.status-badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.status-new { background: #dbeafe; color: #1e40af; }
.status-in-progress { background: #fef3c7; color: #92400e; }
.status-completed { background: #d1fae5; color: #065f46; }
.extra-data-table { font-size: 13px; width: 100%; border-collapse: collapse; margin-top: 10px; }
.extra-data-table td { padding: 5px; border: 1px solid #e5e7eb; }
.extra-data-table tr:nth-child(even) { background: #f9fafb; }

/* ---- Manage Plans (manage_plans.php) ---- */
.plan-card { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 15px; border: 1px solid #e5e7eb; }
.plan-card.featured { border-color: var(--primary-color); background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%); }
.plan-badge { font-size: 10px; background: var(--primary-color); color: white; padding: 3px 10px; border-radius: 20px; margin-left: 8px; font-weight: 600; }
.plan-badge.contact { background: #f59e0b; }
.plan-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 15px 0; }
.plan-stat { background: #f8fafc; padding: 10px; border-radius: 10px; text-align: center; }
.plan-stat strong { display: block; font-size: 16px; color: var(--primary-color); }
.plan-stat span { font-size: 11px; color: #64748b; }
.plan-features { font-size: 12px; color: #475569; margin-top: 10px; line-height: 1.8; }
.plan-features li { margin-left: 18px; }
.btn-small { padding: 8px 14px; font-size: 12px; border-radius: 8px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
@media (min-width: 768px) {
    .plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
}

/* ---- Offline Payments (offline_payments.php) ---- */
.proof-card { background: #fff; border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); border: 1px solid #e5e7eb; }
.proof-card h4 { margin-bottom: 12px; font-size: 17px; }
.proof-img { max-width: 100%; max-height: 300px; border-radius: 12px; border: 1px solid #e2e8f0; cursor: pointer; }
.proof-img:hover { opacity: 0.95; }
.txn-id { background: #f0fdf4; padding: 12px 16px; border-radius: 10px; font-family: monospace; color: #166534; font-weight: 600; margin-top: 10px; }
.proof-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; background: #f8fafc; border-radius: 20px; border: 2px dashed #e2e8f0; }

/* ---- Payment Gateway (payment_gateway_settings.php) ---- */
.payment-option { display: flex; align-items: center; gap: 15px; padding: 18px; border: 2px solid #e5e7eb; border-radius: 14px; margin-bottom: 12px; cursor: pointer; transition: 0.2s; }
.payment-option:hover { border-color: var(--primary-color); background: #f8fafc; }
.payment-option.selected { border-color: var(--primary-color); background: var(--primary-light); }
.payment-option input { margin: 0; }
.payment-option i { font-size: 28px; }
.payment-section { display: none; margin-top: 20px; }
.payment-section.active { display: block; }

/* ---- Approve / reject action buttons (scoped to resolve name clash) ---- */
.btn-approve { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.btn-reject { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.proof-actions .btn-approve { background: #059669; color: white; padding: 12px 24px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.proof-actions .btn-reject { background: #dc2626; color: white; padding: 12px 24px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }

/* =========================================================================
   CLIENT PAGE COMPONENTS (moved out of individual pages, scoped per page
   with a .pg-* class so nothing collides). Do not re-inline these.
   ========================================================================= */

/* ---- Payment Pending (client/payment_pending.php) — scoped .pg-payment_pending ---- */
.pg-payment_pending .card { background: #fff; border-radius: 24px; padding: 40px 30px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.08); border: 1px solid #e2e8f0; text-align: center; }
.pg-payment_pending .icon-box { width: 80px; height: 80px; background: #fef3c7; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.pg-payment_pending .icon-box i { font-size: 36px; color: #d97706; }
.pg-payment_pending h1 { font-size: 22px; color: #1e293b; margin-bottom: 12px; font-weight: 700; }
.pg-payment_pending .alert-box { background: #fffbeb; border: 2px solid #fde047; border-radius: 16px; padding: 20px; margin-bottom: 24px; text-align: left; }
.pg-payment_pending .alert-box strong { color: #b45309; font-size: 15px; display: block; margin-bottom: 8px; }
.pg-payment_pending .alert-box p { color: #78350f; font-size: 14px; line-height: 1.6; }
.pg-payment_pending .wa-btn { display: inline-flex; align-items: center; gap: 12px; background: #25D366; color: white; padding: 16px 28px; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: 16px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(37,211,102,0.4); transition: transform 0.2s; }
.pg-payment_pending .wa-btn:hover { transform: scale(1.02); color: white; }
.pg-payment_pending .wa-num { font-size: 20px; font-weight: 700; color: #0f172a; margin: 15px 0; letter-spacing: 0.5px; }
.pg-payment_pending .logout-link:hover { color: #1e293b; text-decoration: underline; }

/* ---- Payment Rejected (client/payment_rejected.php) — scoped .pg-payment_rejected ---- */
.pg-payment_rejected .card { background: #fff; border-radius: 24px; padding: 40px 30px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.08); border: 2px solid #fecaca; text-align: center; }
.pg-payment_rejected .icon-box { width: 80px; height: 80px; background: #fee2e2; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.pg-payment_rejected .icon-box i { font-size: 36px; color: #dc2626; }
.pg-payment_rejected h1 { font-size: 22px; color: #991b1b; margin-bottom: 12px; font-weight: 700; }
.pg-payment_rejected .alert-box { background: #fef2f2; border: 2px solid #fecaca; border-radius: 16px; padding: 20px; margin-bottom: 24px; text-align: left; }
.pg-payment_rejected .alert-box strong { color: #b91c1c; font-size: 15px; display: block; margin-bottom: 8px; }
.pg-payment_rejected .alert-box p { color: #7f1d1d; font-size: 14px; line-height: 1.6; }
.pg-payment_rejected .wa-btn { display: inline-flex; align-items: center; gap: 12px; background: #25D366; color: white; padding: 16px 28px; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: 16px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(37,211,102,0.4); transition: transform 0.2s; }
.pg-payment_rejected .wa-btn:hover { transform: scale(1.02); color: white; }
.pg-payment_rejected .wa-num { font-size: 20px; font-weight: 700; color: #0f172a; margin: 15px 0; letter-spacing: 0.5px; }
.pg-payment_rejected .logout-link:hover { color: #1e293b; text-decoration: underline; }

/* ---- Change Password (client/change_password.php) — scoped .pg-change_password ---- */
.pg-change_password .back-btn { display: inline-block; margin-bottom: 20px; color: #64748b; text-decoration: none; font-weight: 600; }

/* =========================================================================
   CLIENT PAGE COMPONENTS (moved out of individual pages, scoped per page
   with a .pg-* class so nothing collides). Do not re-inline these.
   ========================================================================= */
:root {
    --wa-in: #ffffff;
    --wa-out: #d9fdd3;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ---- Affiliate (client/affiliate.php) — scoped .pg-affiliate ---- */
.pg-affiliate .stat-details h3 { font-size: 28px; font-weight: 700; margin: 0; }
.pg-affiliate .stat-details p { font-size: 13px; opacity: 0.9; margin: 0; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.pg-affiliate .data-table tbody tr:hover { background: #f8fafc; }
.pg-affiliate .badge-active { background: #ecfdf5; color: #059669; }
.pg-affiliate .badge-inactive { background: #fef2f2; color: #dc2626; }
.pg-affiliate .reward-stat { border: 2px solid #10b981; background: #ecfdf5; }
.pg-affiliate .reward-stat .stat-icon { background: #10b981; color: white; }

/* ---- Birthday Greetings (client/birthday_greetings.php) — scoped .pg-birthday_greetings ---- */
.pg-birthday_greetings .section-title .subtitle { font-size: 13px; color: #6b7280; }
.pg-birthday_greetings .edit-btn { background: #e0f2fe; color: #0284c7; flex: 0.3; }
.pg-birthday_greetings .edit-btn:hover { background: #bae6fd; }
.pg-birthday_greetings .empty-icon { font-size: 48px; color: #d1d5db; margin-bottom: 15px; }
.pg-birthday_greetings .input-group { display: flex; align-items: center; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0 15px; margin-bottom: 20px; }
.pg-birthday_greetings .input-group i { color: #9ca3af; }
.pg-birthday_greetings .app-input { width: 100%; padding: 15px 10px; border: none; background: transparent; outline: none; font-size: 15px; }

/* ---- Blocklist (client/blocklist.php) — scoped .pg-blocklist ---- */
.pg-blocklist .section-title .subtitle { font-size: 13px; color: #6b7280; }
.pg-blocklist .add-form-card { background: #ffffff; border-radius: 20px; padding: 20px; box-shadow: 0 8px 24px rgba(149, 157, 165, 0.08); border: 1px solid #f1f5f9; margin-bottom: 25px; }
.pg-blocklist .input-group { display: flex; align-items: center; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0 15px; margin-bottom: 15px; }
.pg-blocklist .input-group i { color: #9ca3af; }
.pg-blocklist .app-input { width: 100%; padding: 15px 10px; border: none; background: transparent; outline: none; font-size: 15px; }
.pg-blocklist .block-card { background: #ffffff; border-radius: 16px; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; transition: transform 0.2s, box-shadow 0.2s; }
.pg-blocklist .block-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.pg-blocklist .block-info { display: flex; align-items: center; gap: 15px; }
.pg-blocklist .block-icon { width: 44px; height: 44px; background: #fee2e2; color: #dc2626; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.pg-blocklist .block-details h3 { font-size: 16px; font-weight: 600; color: #1e293b; }
.pg-blocklist .block-details .date { font-size: 12px; color: #9ca3af; }
.pg-blocklist .empty-icon { font-size: 48px; color: #d1d5db; margin-bottom: 15px; }

/* ---- Campaign Details (client/campaign_details.php) — scoped .pg-campaign_details ---- */
.pg-campaign_details .back-btn { color: var(--text-main); text-decoration: none; font-size: 20px; }
.pg-campaign_details .grid-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 20px; }
.pg-campaign_details .stat-box { background: #f8fafc; padding: 15px; border-radius: 15px; text-align: center; border: 1px solid #f1f5f9; }
.pg-campaign_details .stat-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; margin-bottom: 5px; }
.pg-campaign_details .stat-value { font-size: 20px; font-weight: 700; }
.pg-campaign_details .stat-sent { color: #10b981; }
.pg-campaign_details .stat-failed { color: #ef4444; }
.pg-campaign_details .progress-container { margin: 20px 0; }
.pg-campaign_details .progress-bar { background: #e2e8f0; height: 12px; border-radius: 10px; overflow: hidden; position: relative; }
.pg-campaign_details .progress-fill { background: var(--primary-color); height: 100%; transition: width 0.5s ease; }
.pg-campaign_details .progress-text { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.pg-campaign_details .chart-box { max-width: 300px; margin: 0 auto 30px auto; }
.pg-campaign_details .log-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 13px; }
.pg-campaign_details .log-table th { text-align: left; padding: 10px; border-bottom: 2px solid #f1f5f9; color: #64748b; font-weight: 600; }
.pg-campaign_details .log-table td { padding: 12px 10px; border-bottom: 1px solid #f8fafc; }
.pg-campaign_details .badge-status { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.pg-campaign_details .badge-sent { background: #dcfce7; color: #16a34a; }
.pg-campaign_details .badge-failed { background: #fee2e2; color: #dc2626; }
@media (min-width: 768px) {
    .pg-campaign_details .grid-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .pg-campaign_details .analytics-layout { display: flex; gap: 30px; }
    .pg-campaign_details .analytics-left { flex: 1; }
    .pg-campaign_details .analytics-right { width: 300px; }
}

/* ---- Campaign History (client/campaign_history.php) — scoped .pg-campaign_history ---- */
.pg-campaign_history .campaign-id { font-family: monospace; font-size: 13px; color: #64748b; margin-bottom: 12px; word-break: break-all; }
.pg-campaign_history .campaign-date { font-size: 15px; font-weight: 600; color: #1e293b; margin-bottom: 15px; }
.pg-campaign_history .stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pg-campaign_history .stat-badge { padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pg-campaign_history .stat-total { background: #f1f5f9; color: #475569; }
.pg-campaign_history .stat-sent { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.pg-campaign_history .stat-failed { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.pg-campaign_history .stat-stopped { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.pg-campaign_history .stat-pending { background: #f0f9ff; color: #0284c7; border: 1px solid #e0f2fe; }
.pg-campaign_history .empty-state i { font-size: 48px; margin-bottom: 15px; opacity: 0.5; }
.pg-campaign_history .back-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--primary-color); text-decoration: none; font-weight: 600; margin-bottom: 20px; font-size: 14px; }
.pg-campaign_history .back-btn:hover { text-decoration: underline; }

/* ---- CTA Button (client/cta_button.php) — scoped .pg-cta_button ---- */
.pg-cta_button .alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.pg-cta_button .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.pg-cta_button .alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.pg-cta_button .cta-type-btns { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.pg-cta_button .cta-type-btn { flex: 1; min-width: 140px; padding: 16px 20px; border: 2px solid #e2e8f0; border-radius: 14px; background: #f8fafc; cursor: pointer; text-align: center; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pg-cta_button .cta-type-btn i { font-size: 28px; color: #64748b; }
.pg-cta_button .cta-type-btn span { font-weight: 600; font-size: 14px; color: #334155; }
.pg-cta_button .cta-type-btn:hover { border-color: var(--primary-color); background: var(--primary-light); }
.pg-cta_button .cta-type-btn:hover i, .pg-cta_button .cta-type-btn:hover span { color: var(--primary-color); }
.pg-cta_button .cta-type-btn.active { border-color: var(--primary-color); background: var(--primary-light); }
.pg-cta_button .cta-type-btn.active i, .pg-cta_button .cta-type-btn.active span { color: var(--primary-color); }
.pg-cta_button .cta-type-btn input { display: none; }
.pg-cta_button .media-upload-box { border: 2px dashed #e2e8f0; border-radius: 14px; padding: 30px; text-align: center; cursor: pointer; background: #f8fafc; transition: all 0.2s; }
.pg-cta_button .media-upload-box:hover { border-color: var(--primary-color); background: var(--primary-light); }
.pg-cta_button .media-upload-box i { font-size: 32px; color: var(--primary-color); margin-bottom: 10px; display: block; }
.pg-cta_button .media-upload-box p { font-size: 14px; color: #64748b; }
.pg-cta_button #media_preview { display: none; margin-top: 10px; font-size: 13px; color: #059669; }

/* ---- Export Participants (client/export_participants.php) — scoped .pg-export_participants ---- */
.pg-export_participants .select-box { background: white; padding: 20px; border-radius: 16px; border: 1px solid #e5e7eb; margin-bottom: 25px; }
.pg-export_participants .select-label { font-size: 13px; font-weight: 600; color: #4b5563; text-transform: uppercase; margin-bottom: 10px; display: block; letter-spacing: 0.5px; }
.pg-export_participants .select-wrapper { position: relative; }
.pg-export_participants .select-wrapper::after { content: '\f107'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.pg-export_participants #loader { display: none; text-align: center; padding: 40px 20px; }
.pg-export_participants .spinner-icon { font-size: 45px; color: var(--primary-color); margin-bottom: 15px; }
.pg-export_participants .loader-text { color: #6b7280; font-weight: 500; font-size: 14px; }
.pg-export_participants .group-card { background: #ffffff; border-radius: 16px; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); border: 1px solid #f3f4f6; transition: 0.2s; }
.pg-export_participants .group-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.pg-export_participants .card-details .group-id { font-size: 11px; color: #9ca3af; font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-export_participants .badges-wrapper { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pg-export_participants .badge-participants { background: #f3f4f6; color: #4b5563; }
.pg-export_participants .badge-admin { background: #d1fae5; color: #065f46; }
.pg-export_participants .download-btn { background: var(--primary-color); color: #ffffff; }
.pg-export_participants .download-btn:active { transform: scale(0.98); }

/* ---- Greeting Cards (client/greeting_cards.php) — scoped .pg-greeting_cards ---- */
.pg-greeting_cards .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pg-greeting_cards .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.pg-greeting_cards .preview-text { position: absolute; pointer-events: auto; white-space: nowrap; border: 2px dashed #25D366; padding: 2px 5px; border-radius: 6px; background: rgba(255,255,255,0.2); }
.pg-greeting_cards .preview-text:hover { background: rgba(255,255,255,0.4); border-color: #10b981; }

/* ---- Live Chat (client/live_chat.php) — scoped .pg-live_chat ---- */
.pg-live_chat .chat-container { display: flex; flex: 1; overflow: hidden; position: relative; }
.pg-live_chat .chat-sidebar { width: 320px; background: #ffffff; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; height: 100%; }
.pg-live_chat .chat-sidebar-header { padding: 15px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; }
.pg-live_chat .chat-list { flex: 1; overflow-y: auto; }
.pg-live_chat .chat-item { padding: 15px; border-bottom: 1px solid #f3f4f6; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: 0.2s; }
.pg-live_chat .chat-item:hover, .pg-live_chat .chat-item.active { background: #f0f9ff; border-left: 3px solid var(--primary-color); }
.pg-live_chat .chat-avatar { width: 45px; height: 45px; background: var(--primary-light); color: var(--primary-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 18px; }
.pg-live_chat .chat-info { flex: 1; overflow: hidden; }
.pg-live_chat .chat-name { font-weight: 600; font-size: 14px; color: #1f2937; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-live_chat .chat-preview { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-live_chat .chat-main { flex: 1; display: flex; flex-direction: column; background: #f0f2f5; position: relative; height: 100%; }
.pg-live_chat .empty-chat { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #9ca3af; text-align: center; background: #f8fafc; }
.pg-live_chat .empty-chat i { font-size: 60px; margin-bottom: 15px; color: #cbd5e1; }
.pg-live_chat .chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background-image: url('data:image/svg+xml,%3Csvg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23e2e8f0" fill-opacity="0.4" fill-rule="evenodd"%3E%3Ccircle cx="3" cy="3" r="3"/%3E%3Ccircle cx="13" cy="13" r="3"/%3E%3C/g%3E%3C/svg%3E'); }
.pg-live_chat .msg-bubble { max-width: 75%; padding: 10px 15px; border-radius: 12px; font-size: 14px; position: relative; line-height: 1.5; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.pg-live_chat .msg-in { background: #ffffff; align-self: flex-start; border-top-left-radius: 0; color: #1e293b; }
.pg-live_chat .msg-out { background: #dcf8c6; align-self: flex-end; border-top-right-radius: 0; color: #1e293b; }
.pg-live_chat .msg-time { font-size: 10px; color: rgba(0,0,0,0.45); text-align: right; margin-top: 5px; display: block; }
.pg-live_chat .k-tab { background: #f1f5f9; border:none; padding: 6px 12px; border-radius:15px; font-size:11px; font-weight:600; color:#64748b; cursor:pointer; white-space:nowrap; transition:0.2s; }
.pg-live_chat .k-tab.active { background: var(--primary-color); color:white; }
.pg-live_chat .k-tab:hover { filter: brightness(0.95); }
.pg-live_chat .kanban-tabs::-webkit-scrollbar { height: 4px; }
.pg-live_chat .kanban-tabs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius:4px; }
.pg-live_chat .chat-input-area { background: #f0f2f5; padding: 15px 20px; display: flex; align-items: center; gap: 10px; border-top: 1px solid #e2e8f0; }
.pg-live_chat .chat-input { flex: 1; padding: 12px 20px; border: none; border-radius: 24px; font-size: 15px; outline: none; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.pg-live_chat .send-btn { width: 45px; height: 45px; background: var(--primary-color); color: white; border: none; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 18px; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.pg-live_chat .send-btn:active { transform: scale(0.95); }
.pg-live_chat .mobile-back-btn { display: none; background: transparent; border: none; font-size: 20px; color: #475569; padding-right: 15px; cursor: pointer; }
@media (max-width: 767px) {
    .pg-live_chat .chat-header { padding: 10px 15px; background: white; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 10; }
    .pg-live_chat .chat-sidebar { width: 100%; border-right: none; height: 100%; }
    .pg-live_chat .chat-main { position: fixed; top: 0; left: 100%; width: 100%; height: 100dvh; z-index: 200; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); background: #f0f2f5; display: flex; flex-direction: column; }
    .pg-live_chat .chat-main.active { left: 0; }
    .pg-live_chat .mobile-back-btn { display: block; }
    .pg-live_chat .chat-input-area { padding: 10px 15px; background: #ffffff; border-top: 1px solid #e5e7eb; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .pg-live_chat #activeChat { display: flex; flex-direction: column; height: 100%; width: 100%; }
}

/* ---- Message Logs (client/message_logs.php) — scoped .pg-message_logs ---- */
.pg-message_logs .layout-container { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.pg-message_logs .header-mobile-thread { display: none; }
.pg-message_logs .filter-header { background: #fff; padding: 15px 20px; border-bottom: 1px solid #f1f5f9; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.pg-message_logs .filter-content { background: #fff; padding: 0 20px 20px 20px; border-bottom: 1px solid #f1f5f9; display: none; }
.pg-message_logs .filter-content.active { display: block; }
.pg-message_logs .btn-row { display: flex; gap: 10px; margin-top: 15px; }
.pg-message_logs .app-btn { flex: 1; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; transition: 0.2s; }
.pg-message_logs .btn-primary { background: var(--primary-color); color: #fff; }
.pg-message_logs .btn-ghost { background: #f1f5f9; color: #475569; }
.pg-message_logs .app-card.active { border-color: var(--primary-color); background: var(--primary-light); }
.pg-message_logs .badge-count { background: var(--primary-color); color: #fff; border: none; }
.pg-message_logs .thread-pane-header { padding: 15px 20px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 15px; z-index: 10; position: sticky; top: 0; }
.pg-message_logs .thread-pane-header h2 { font-size: 16px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-message_logs .back-btn { background: #f1f5f9; border: none; width: 38px; height: 38px; border-radius: 10px; color: #475569; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pg-message_logs .thread-area { flex: 1; overflow-y: auto; padding: 20px; background: #0b141a url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M0 0h30v30H0zm30 30h30v30H30z'/%3E%3C/g%3E%3C/svg%3E"); }
.pg-message_logs .bubble-wrap { display: flex; margin-bottom: 15px; }
.pg-message_logs .bubble-wrap.in { justify-content: flex-start; }
.pg-message_logs .bubble-wrap.out { justify-content: flex-end; }
.pg-message_logs .bubble-wrap.fail { justify-content: center; }
.pg-message_logs .bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: relative; }
.pg-message_logs .bubble-in { background: var(--wa-in); color: #111; border-top-left-radius: 4px; }
.pg-message_logs .bubble-out { background: var(--wa-out); color: #111; border-top-right-radius: 4px; }
.pg-message_logs .bubble-fail { background: #fee2e2; color: #991b1b; border-radius: 12px; max-width: 90%; text-align: center; font-size: 13px; }
.pg-message_logs .bubble-meta { font-size: 10px; color: #94a3b8; margin-top: 5px; display: flex; gap: 10px; justify-content: flex-end; }
.pg-message_logs .bubble-in .bubble-meta { justify-content: flex-start; }
.pg-message_logs .transcript-box { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,0.1); font-size: 12px; font-style: italic; opacity: 0.8; }
.pg-message_logs .pager { display: flex; gap: 8px; justify-content: center; padding: 20px; background: #fff; border-top: 1px solid #f1f5f9; }
.pg-message_logs .pager a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.pg-message_logs .pager a.on { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
@media (min-width: 900px) {
    .pg-message_logs .layout-container { flex: 1; flex-direction: row; height: 100vh; overflow: hidden; }
    .pg-message_logs .pane-left { width: 380px; min-width: 380px; border-right: 1px solid #e2e8f0; background: #ffffff; display: flex; flex-direction: column; }
    .pg-message_logs .pane-right { flex: 1; display: flex; flex-direction: column; background: var(--bg-color); }
    .pg-message_logs .pager-container { position: sticky; bottom: 0; width: 100%; }
}
@media (max-width: 899px) {
    .pg-message_logs .pane-left.hide-on-thread { display: none; }
    .pg-message_logs .pane-right { display: none; flex: 1; flex-direction: column; background: var(--bg-color); min-height: 100vh; }
    .pg-message_logs .pane-right.show { display: flex; }
}

/* ---- Orders (client/orders.php) — scoped .pg-orders ---- */
.pg-orders .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 25px; }
.pg-orders .stat-box { background: #fff; padding: 14px 16px; border-radius: 18px; border: 1px solid #f1f5f9; box-shadow: 0 4px 12px rgba(0,0,0,0.03); cursor: pointer; transition: 0.2s; text-decoration: none; display: block; }
.pg-orders .stat-box:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.07); }
.pg-orders .stat-box h4 { font-size: 24px; font-weight: 800; color: var(--text-main); }
.pg-orders .stat-box p { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-top: 2px; }
.pg-orders .stat-box.active { border-color: var(--primary-color); background: var(--primary-light); }
.pg-orders .stat-box.active h4 { color: var(--primary-color); }
.pg-orders .stat-box.stat-new.active { border-color: #f59e0b; background: #fffbeb; }
.pg-orders .stat-box.stat-new.active h4 { color: #d97706; }
.pg-orders .stat-box.stat-conf.active { border-color: #3b82f6; background: #eff6ff; }
.pg-orders .stat-box.stat-conf.active h4 { color: #2563eb; }
.pg-orders .stat-box.stat-comp.active { border-color: #059669; background: #ecfdf5; }
.pg-orders .stat-box.stat-comp.active h4 { color: #059669; }
.pg-orders .stat-box.stat-rej.active { border-color: #dc2626; background: #fef2f2; }
.pg-orders .stat-box.stat-rej.active h4 { color: #dc2626; }
.pg-orders .filter-section { background: #fff; padding: 12px; border-radius: 16px; margin-bottom: 25px; border: 1px solid #f1f5f9; display: flex; gap: 10px; flex-wrap: wrap; }
.pg-orders .search-input { flex: 1; min-width: 160px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 15px; font-size: 14px; outline: none; }
.pg-orders .filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-orders .filter-tab { padding: 8px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; border: 1.5px solid #e2e8f0; background: #f8fafc; color: #64748b; text-decoration: none; cursor: pointer; white-space: nowrap; transition: 0.2s; }
.pg-orders .filter-tab:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pg-orders .filter-tab.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.pg-orders .filter-tab.tab-new.active { background: #f59e0b; border-color: #f59e0b; }
.pg-orders .filter-tab.tab-conf.active { background: #3b82f6; border-color: #3b82f6; }
.pg-orders .filter-tab.tab-comp.active { background: #059669; border-color: #059669; }
.pg-orders .filter-tab.tab-rej.active { background: #dc2626; border-color: #dc2626; }
.pg-orders .card-details .phone { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.pg-orders .badge-confirmed { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.pg-orders .badge-inprogress { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.pg-orders .requirement-box { background: #f8fafc; padding: 15px; border-radius: 15px; border: 1px solid #f1f5f9; margin-bottom: 15px; }
.pg-orders .req-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-bottom: 8px; display: block; }
.pg-orders .req-text { font-size: 14px; line-height: 1.6; color: #334155; }
.pg-orders .extra-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pg-orders .tag { background: #f1f5f9; padding: 5px 12px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #64748b; border: 1px solid #e2e8f0; }
.pg-orders .tag strong { color: #334155; }
.pg-orders .conf-btn { background: #eff6ff; color: #2563eb; }
.pg-orders .conf-btn:hover { background: #dbeafe; }
.pg-orders .comp-btn { background: #ecfdf5; color: #059669; }
.pg-orders .comp-btn:hover { background: #d1fae5; }
.pg-orders .rej-btn { background: #fef2f2; color: #dc2626; }
.pg-orders .rej-btn:hover { background: #fee2e2; }
.pg-orders .order-lines-editor { width: 100%; margin: 0 0 14px 0; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid #e2e8f0; }
.pg-orders .order-lines-editor .editor-title { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-bottom: 10px; display: block; }
.pg-orders .order-lines-wrap { display: flex; flex-direction: column; gap: 10px; }
.pg-orders .order-line-row { display: grid; grid-template-columns: minmax(0,1fr) 76px 88px 78px 40px; gap: 8px; align-items: center; }
.pg-orders .order-line-row input[type="text"], .pg-orders .order-line-row input[type="number"] { width: 100%; padding: 10px 8px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 13px; background: #f8fafc; }
.pg-orders .order-line-row input:focus { outline: none; border-color: var(--primary-color); background: #fff; }
.pg-orders .line-total-val { font-size: 13px; font-weight: 700; color: #0f172a; text-align: right; font-variant-numeric: tabular-nums; }
.pg-orders .remove-order-line { border: none; background: #fef2f2; color: #dc2626; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.pg-orders .remove-order-line:hover { background: #fee2e2; }
.pg-orders .add-order-line { margin-top: 6px; padding: 8px 14px; border-radius: 10px; border: 1px dashed #cbd5e1; background: #f8fafc; color: #475569; font-size: 12px; font-weight: 600; cursor: pointer; width: 100%; }
.pg-orders .add-order-line:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pg-orders .grand-total-display { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e2e8f0; font-size: 15px; font-weight: 700; color: #0f172a; }
.pg-orders .grand-total-display .grand-total-val { color: var(--primary-color); font-variant-numeric: tabular-nums; }
.pg-orders .alt-wa-field { margin-top: 14px; }
.pg-orders .alt-wa-field label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; display: block; margin-bottom: 6px; }
.pg-orders .alt-wa-field input { width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; background: #f8fafc; }
.pg-orders .alt-wa-field input:focus { outline: none; border-color: var(--primary-color); background: #fff; }
.pg-orders .alt-wa-field .hint { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.pg-orders .line-total-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.pg-orders .line-ttl-lbl { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
@media (max-width: 520px) {
    .pg-orders .order-line-row { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
    .pg-orders .order-line-row .line-total-cell { display: flex; justify-content: space-between; align-items: center; }
    .pg-orders .remove-order-line { align-self: flex-end; }
}
@media (min-width: 768px) {
    .pg-orders .stats-grid { grid-template-columns: repeat(5, 1fr); gap: 15px; }
    .pg-orders .filter-section { flex-wrap: nowrap; }
}

/* ---- Process (client/process.php) — scoped .pg-process ---- */
.pg-process .loader-ring { display: inline-block; width: 70px; height: 70px; border: 6px solid #f3f4f6; border-top: 6px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
.pg-process .stat-container { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0; }
.pg-process .stat-box { flex: 1; background: #f8fafc; padding: 15px; border-radius: 12px; border: 1px solid #e5e7eb; }
.pg-process .stat-value { font-size: 24px; font-weight: 800; display: block; margin-bottom: 5px; }
.pg-process .val-sent { color: #10b981; }
.pg-process .val-pending { color: #f59e0b; }
.pg-process .val-failed { color: #ef4444; }
.pg-process .btn-danger { background: #ef4444; color: white; border: none; padding: 12px 25px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; width: 100%; margin-bottom: 10px; }
.pg-process .btn-primary { background: var(--primary-color); color: white; text-decoration: none; padding: 12px 25px; border-radius: 10px; display: inline-block; width: 100%; font-weight: 600; }
.pg-process .alert-box { background: #dbeafe; color: #0369a1; padding: 12px; border-radius: 10px; font-size: 13px; font-weight: 500; margin-bottom: 20px; }

/* ---- Profile (client/profile.php) — scoped .pg-profile ---- */
.pg-profile .profile-wrapper { width: 100%; max-width: 600px; animation: fadeIn 0.4s ease-out; }
.pg-profile .back-btn { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 15px; transition: 0.2s; }
.pg-profile .back-btn:hover { color: var(--primary-color); transform: translateX(-4px); }
.pg-profile .card-header { text-align: center; margin-bottom: 35px; }
.pg-profile .card-header h2 { font-size: 24px; color: var(--text-main); font-weight: 700; }
.pg-profile .profile-pic-preview { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 8px 16px var(--primary-light); margin: 0 auto 15px auto; display: block; }
.pg-profile .avatar-placeholder { width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-light), #ffffff); color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; margin: 0 auto 15px auto; border: 3px solid #fff; box-shadow: 0 8px 16px var(--primary-light); }
.pg-profile .form-row .form-group { margin-bottom: 0; }
.pg-profile .readonly-input { background-color: #f1f5f9; color: #94a3b8; cursor: not-allowed; border-color: #e2e8f0; }
.pg-profile .file-input-wrapper { position: relative; overflow: hidden; display: inline-block; width: 100%; }
.pg-profile .file-input-wrapper input[type=file] { font-size: 14px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; height: 100%; width: 100%; }
.pg-profile .btn-upload { display: flex; align-items: center; justify-content: center; gap: 8px; background: #f8fafc; border: 2px dashed #cbd5e1; padding: 12px; border-radius: 12px; color: var(--text-muted); font-weight: 500; font-size: 14px; transition: 0.3s; }
.pg-profile .file-input-wrapper:hover .btn-upload { background: #f0f9ff; border-color: #93c5fd; color: #3b82f6; }
.pg-profile .alert { padding: 16px 20px; border-radius: 14px; margin-bottom: 25px; font-weight: 500; display: flex; align-items: center; gap: 12px; animation: fadeIn 0.3s ease-out; }
.pg-profile .alert-success { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pg-profile .alert-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ---- Send Message (client/send_message.php) — scoped .pg-send_message ---- */
.pg-send_message .media-upload-box { border: 2px dashed #cbd5e1; background: #f8fafc; padding: 25px 15px; border-radius: 12px; text-align: center; cursor: pointer; transition: 0.2s; }
.pg-send_message .media-upload-box:hover { border-color: var(--primary-color); background: #f0fdf4; }
.pg-send_message #upload_text { font-size: 13px; color: #64748b; margin-top: 8px; font-weight: 500; }
.pg-send_message #media_preview { margin-top: 10px; font-size: 13px; color: var(--primary-color); font-weight: 600; display: none; padding: 10px; background: var(--primary-light); border-radius: 8px; }
.pg-send_message .time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.pg-send_message .app-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.pg-send_message #progressBox { display: none; text-align: center; padding: 30px 20px; }
.pg-send_message .loader-ring { display: inline-block; width: 70px; height: 70px; border: 6px solid #f3f4f6; border-top: 6px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
.pg-send_message #statusTitle { font-size: 22px; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.pg-send_message #statusSub { font-size: 13px; color: #6b7280; margin-bottom: 25px; line-height: 1.5; }
.pg-send_message .media-upload-box { border: 2px dashed #cbd5e1; background: #f8fafc; padding: 25px 15px; border-radius: 12px; text-align: center; cursor: pointer; transition: 0.2s; }
.pg-send_message .media-upload-box:hover { border-color: var(--primary-color); background: #f0fdf4; }
.pg-send_message #upload_text { font-size: 13px; color: #64748b; margin-top: 8px; font-weight: 500; }
.pg-send_message #media_preview { margin-top: 10px; font-size: 13px; color: var(--primary-color); font-weight: 600; display: none; padding: 10px; background: var(--primary-light); border-radius: 8px; }
.pg-send_message .time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.pg-send_message .app-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.pg-send_message #progressBox { display: none; text-align: center; padding: 30px 20px; }
.pg-send_message .loader-ring { display: inline-block; width: 70px; height: 70px; border: 6px solid #f3f4f6; border-top: 6px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
.pg-send_message #statusTitle { font-size: 22px; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.pg-send_message #statusSub { font-size: 13px; color: #6b7280; margin-bottom: 25px; line-height: 1.5; }
.pg-send_message .stat-value { font-size: 38px; font-weight: 800; color: var(--primary-color); display: block; line-height: 1.1; margin-bottom: 5px; }
.pg-send_message .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; font-weight: 600; }
.pg-send_message .btn-danger { background: #f1416c; color: white; border: none; padding: 14px 30px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 767px) {
    .pg-send_message #sendBtn { position: fixed; bottom: 60px; left: 0; width: 100%; background: var(--primary-color); padding: 15px 20px; box-shadow: 0 -4px 15px rgba(0,0,0,0.06); z-index: 95; margin: 0 !important; border-radius: 0; }
}

/* ---- Staff Accounts (client/staff_accounts.php) — scoped .pg-staff_accounts ---- */
.pg-staff_accounts .staff-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.pg-staff_accounts .staff-card { background: #ffffff; border-radius: 16px; padding: 25px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.pg-staff_accounts .staff-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }
.pg-staff_accounts .staff-info { display: flex; align-items: center; gap: 15px; flex: 1; }
.pg-staff_accounts .staff-avatar { width: 50px; height: 50px; background: #e0e7ff; color: #4338ca; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.pg-staff_accounts .staff-details h4 { margin-bottom: 5px; color: #1e293b; font-size: 16px; }
.pg-staff_accounts .staff-details p { color: #64748b; font-size: 13px; line-height: 1.6; display: flex; flex-direction: column; gap: 4px; }
.pg-staff_accounts .staff-details p span { display: flex; align-items: center; gap: 8px; }
.pg-staff_accounts .action-btns { display: flex; gap: 8px; flex-shrink: 0; }
.pg-staff_accounts .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.pg-staff_accounts .modal-overlay.active { display: flex; opacity: 1; visibility: visible; }
.pg-staff_accounts .modal-box { background: #ffffff; width: 100%; max-width: 450px; border-radius: 20px; padding: 25px 30px; transform: translateY(20px); transition: 0.3s; box-shadow: 0 20px 50px rgba(0,0,0,0.1); margin: 0 20px; }
.pg-staff_accounts .modal-overlay.active .modal-box { transform: translateY(0); }
.pg-staff_accounts .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.pg-staff_accounts .modal-header h3 { font-size: 18px; color: #1e293b; }
.pg-staff_accounts .btn-close { background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 50%; color: #64748b; cursor: pointer; transition: 0.2s; }
.pg-staff_accounts .btn-close:hover { background: #e2e8f0; color: #1e293b; }
.pg-staff_accounts label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 8px; }

/* ---- View Contacts (client/view_contacts.php) — scoped .pg-view_contacts ---- */
.pg-view_contacts .back-btn { color: var(--text-main); text-decoration: none; font-size: 20px; }
.pg-view_contacts .group-hero { background: linear-gradient(135deg, var(--primary-color), #10b981); color: white; padding: 25px 20px; border-radius: 16px; margin-bottom: 25px; box-shadow: 0 5px 15px var(--primary-light); text-align: center; }
.pg-view_contacts .group-hero h2 { font-size: 22px; font-weight: 700; margin-bottom: 5px; }
.pg-view_contacts .group-hero p { font-size: 14px; opacity: 0.9; }
.pg-view_contacts .group-hero .badge { display: inline-block; background: rgba(255,255,255,0.2); padding: 5px 15px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-top: 10px; backdrop-filter: blur(5px); }
.pg-view_contacts .contact-list { display: flex; flex-direction: column; gap: 10px; }
.pg-view_contacts .contact-card { background: #ffffff; padding: 15px 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e5e7eb; box-shadow: 0 2px 5px rgba(0,0,0,0.01); }
.pg-view_contacts .contact-info { display: flex; align-items: center; gap: 15px; }
.pg-view_contacts .contact-icon { width: 40px; height: 40px; background: #f3f4f6; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 18px; }
.pg-view_contacts .contact-icon.wa-icon { background: #dcfce7; color: #16a34a; }
.pg-view_contacts .contact-details h4 { font-size: 15px; color: #1f2937; font-weight: 600; margin-bottom: 2px; }
.pg-view_contacts .contact-details.manual h4 { font-family: monospace; letter-spacing: 0.5px; font-size: 16px; }
.pg-view_contacts .contact-details p { font-size: 11px; color: #9ca3af; }
.pg-view_contacts .btn-delete:active { transform: scale(0.9); }
.pg-view_contacts .btn-pause { border: none; background: #dcfce7; color: #16a34a; width: 35px; height: 35px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.pg-view_contacts .btn-pause.paused { background: #fef3c7; color: #d97706; }
.pg-view_contacts .btn-pause:active { transform: scale(0.9); }
.pg-view_contacts .sheet-subtitle { font-size: 12px; color: #6b7280; text-align: center; margin-bottom: 20px; line-height: 1.4; }
@media (min-width: 768px) {
    .pg-view_contacts .contact-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
}

/* =========================================================================
   CLIENT PAGE COMPONENTS (moved out of individual pages, scoped per page
   with a .pg-* class so nothing collides). Do not re-inline these.
   ========================================================================= */

/* ---- Contacts (client/contacts.php) — scoped .pg-contacts ---- */
.pg-contacts .section-title .subtitle { font-size: 13px; color: #6b7280; }
.pg-contacts .edit-btn { background: #e0f2fe; color: #0284c7; flex: 0.3; }
.pg-contacts .edit-btn:hover { background: #bae6fd; }
.pg-contacts .empty-icon { font-size: 48px; color: #d1d5db; margin-bottom: 15px; }
.pg-contacts .input-group { display: flex; align-items: center; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0 15px; margin-bottom: 20px; }
.pg-contacts .input-group i { color: #9ca3af; }
.pg-contacts .app-input { width: 100%; padding: 15px 10px; border: none; background: transparent; outline: none; font-size: 15px; }

/* =========================================================================
   CLIENT PAGE COMPONENTS (moved out of individual pages, scoped per page
   with a .pg-* class so nothing collides). Do not re-inline these.
   ========================================================================= */
:root {
    --wa-green: #25D366;
    --wa-teal-dark: #075E54;
    --wa-teal-light: #128C7E;
    --wa-bg: #F0F2F5;
    --wa-chat-bg: #EFEAE2;
    --text-dark: #111B21;
    --white: #ffffff;
    --primary-dark: #1da851;
}
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Home (index.php) — scoped .pg-index ---- */
.pg-index .navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 8%; position: fixed; top: 0; width: 100%; z-index: 1000; background: var(--white); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); transition: 0.3s; }
.pg-index .logo { font-size: 22px; font-weight: 900; color: var(--wa-teal-dark); display: flex; align-items: center; gap: 10px; }
.pg-index .logo img { height: 40px; border-radius: 8px; }
.pg-index .nav-links { display: flex; gap: 15px; align-items: center; }
.pg-index .menu-toggle { display: none; font-size: 26px; color: var(--text-dark); cursor: pointer; }
.pg-index .btn { padding: 12px 28px; border-radius: 50px; font-size: 15px; font-weight: 700; text-decoration: none; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.pg-index .btn-outline { color: var(--wa-teal-dark); border: 2px solid #e9edef; background: var(--white); }
.pg-index .btn-outline:hover { border-color: var(--wa-green); color: var(--wa-teal-dark); }
.pg-index .btn-primary { background: var(--wa-green); color: var(--white); box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); }
.pg-index .btn-primary:hover { background: var(--wa-teal-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(18, 140, 126, 0.4); }
.pg-index .btn-primary:active { transform: scale(0.96); }
.pg-index .hero { padding: 160px 8% 80px; display: flex; align-items: center; justify-content: space-between; gap: 50px; background: linear-gradient(135deg, #ffffff 0%, #e2f5ec 100%); min-height: 90vh; position: relative; }
.pg-index .hero-text { flex: 1.2; animation: fadeUp 1s ease forwards; }
.pg-index .hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; background: #dcf8c6; color: var(--wa-teal-dark); border-radius: 50px; font-size: 13px; font-weight: 700; margin-bottom: 20px; }
.pg-index .hero-text h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 900; line-height: 1.2; margin-bottom: 20px; color: var(--text-dark); }
.pg-index .hero-text h1 span { color: var(--wa-green); }
.pg-index .hero-text p { font-size: clamp(16px, 2vw, 18px); color: var(--text-muted); margin-bottom: 40px; line-height: 1.6; }
.pg-index .hero-buttons { display: flex; gap: 15px; flex-wrap: wrap; }
.pg-index .hero-image { flex: 1; position: relative; animation: float 5s ease-in-out infinite; }
.pg-index .hero-image img { width: 100%; max-width: 500px; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.1)); }
.pg-index .stats-section { background: var(--wa-teal-dark); padding: 60px 8%; position: relative; margin-top: -30px; z-index: 10; }
.pg-index .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; text-align: center; }
.pg-index .stat-card i { font-size: 40px; color: var(--wa-green); margin-bottom: 15px; }
.pg-index .stat-card h2 { font-size: 42px; font-weight: 900; margin-bottom: 5px; }
.pg-index .features { padding: 100px 8%; background: var(--white); text-align: center; }
.pg-index .section-subtitle { color: var(--text-muted); font-size: 16px; margin-bottom: 60px; }
.pg-index .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.pg-index .feature-card { background: var(--white); padding: 40px 30px; border-radius: 24px; transition: all 0.3s ease; border: 1px solid #e9edef; box-shadow: 0 4px 15px rgba(0,0,0,0.02); text-align: left; position: relative; }
.pg-index .feature-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,0.06); border-color: var(--wa-green); }
.pg-index .icon-box { width: 60px; height: 60px; background: #dcf8c6; color: var(--wa-teal-dark); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 20px; }
.pg-index .feature-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: var(--text-dark); }
.pg-index .feature-card p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.pg-index .pricing-section { padding: 100px 8%; background: linear-gradient(180deg, #f8fafc 0%, var(--wa-bg) 100%); text-align: center; }
.pg-index .pricing-section .section-title { margin-bottom: 15px; }
.pg-index .pricing-section .section-subtitle { margin-bottom: 50px; }
.pg-index .pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; max-width: 1100px; margin: 0 auto; align-items: stretch; }
.pg-index .pricing-card { background: var(--white); border-radius: 24px; padding: 40px 30px; border: 2px solid #e9edef; box-shadow: 0 8px 30px rgba(0,0,0,0.06); transition: all 0.3s ease; display: flex; flex-direction: column; text-align: center; }
.pg-index .pricing-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.08); border-color: var(--wa-green); }
.pg-index .pricing-card.featured { border-color: var(--wa-green); background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%); box-shadow: 0 12px 40px rgba(37, 211, 102, 0.2); position: relative; padding-top: 50px; }
.pg-index .pricing-card.featured::before { content: attr(data-badge); position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--wa-green); color: white; font-size: 11px; font-weight: 700; padding: 5px 18px; border-radius: 50px; letter-spacing: 1px; }
.pg-index .pricing-card h3 { font-size: 22px; font-weight: 900; color: var(--wa-teal-dark); margin-bottom: 8px; }
.pg-index .pricing-card .price-box { margin: 20px 0 25px 0; }
.pg-index .pricing-card .price { font-size: 42px; font-weight: 900; color: var(--text-dark); }
.pg-index .pricing-card .price.multi-tier { font-size: 15px; font-weight: 600; line-height: 1.6; }
.pg-index .pricing-card .price span { font-size: 16px; font-weight: 500; color: var(--text-muted); }
.pg-index .pricing-card .price-period { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.pg-index .pricing-card ul { list-style: none; text-align: left; flex: 1; margin-bottom: 30px; }
.pg-index .pricing-card ul li { padding: 10px 0; font-size: 15px; color: var(--text-dark); display: flex; align-items: center; gap: 12px; border-bottom: 1px dashed #e9edef; }
.pg-index .pricing-card ul li:last-child { border-bottom: none; }
.pg-index .pricing-card ul li i { color: var(--wa-green); font-size: 18px; flex-shrink: 0; }
.pg-index .pricing-card .btn { width: 100%; justify-content: center; margin-top: auto; }
.pg-index .contact-section { padding: 80px 8%; background: var(--wa-bg); }
.pg-index .contact-wrapper { background: var(--white); border-radius: 30px; padding: 50px; box-shadow: 0 10px 40px rgba(0,0,0,0.04); max-width: 1000px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.pg-index .contact-info { flex: 1; min-width: 300px; }
.pg-index .contact-info h2 { font-size: 32px; font-weight: 900; margin-bottom: 20px; color: var(--wa-teal-dark); }
.pg-index .contact-item { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 25px; }
.pg-index .contact-item i { font-size: 24px; color: var(--wa-green); margin-top: 5px; }
.pg-index .contact-item div h4 { font-size: 18px; color: var(--text-dark); margin-bottom: 5px; }
.pg-index .contact-item div p { font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.pg-index .contact-item a { color: var(--text-dark); text-decoration: none; font-weight: 700; font-size: 20px; transition: 0.2s; }
.pg-index .contact-item a:hover { color: var(--wa-green); }
.pg-index .contact-action { flex: 1; text-align: center; min-width: 300px; background: #f8fafc; padding: 40px; border-radius: 20px; }
.pg-index .contact-action h3 { margin-bottom: 20px; color: var(--text-dark); font-size: 24px; }
.pg-index footer { padding: 30px 8%; text-align: center; color: var(--text-muted); font-size: 15px; background: var(--white); border-top: 1px solid #e9edef; }
.pg-index footer strong { color: var(--wa-teal-dark); }
@media (max-width: 992px) {
    .pg-index .hero { flex-direction: column; text-align: center; padding: 140px 5% 60px; }
    .pg-index .hero-text { display: flex; flex-direction: column; align-items: center; }
    .pg-index .hero-buttons { justify-content: center; }
    .pg-index .pricing-section { padding: 60px 5%; }
    .pg-index .pricing-grid { gap: 25px; }
    .pg-index .contact-wrapper { padding: 30px; flex-direction: column; text-align: center; }
    .pg-index .contact-item { flex-direction: column; align-items: center; text-align: center; }
}
@media (max-width: 768px) {
    .pg-index .navbar { padding: 15px 5%; }
    .pg-index .menu-toggle { display: block; }
    .pg-index .nav-links { position: absolute; top: 100%; left: 0; width: 100%; background: var(--white); flex-direction: column; padding: 20px 5%; box-shadow: 0 10px 20px rgba(0,0,0,0.05); gap: 15px; display: none; border-top: 1px solid #e9edef; }
    .pg-index .nav-links.active { display: flex; animation: fadeUp 0.3s ease; }
    .pg-index .nav-links .btn { width: 100%; justify-content: center; }
    .pg-index .hero-text h1 { font-size: 32px; }
    .pg-index .stats-section { padding: 40px 5%; }
    .pg-index .stat-card h2 { font-size: 36px; }
    .pg-index .pricing-section { padding: 50px 5%; }
    .pg-index .pricing-card .price { font-size: 36px; }
}

/* ---- Sign In (login.php) — scoped .pg-login ---- */
.pg-login .login-wrapper { width: 100%; max-width: 400px; }
.pg-login .brand-logo { margin-bottom: 20px; }
.pg-login .brand-logo img { max-height: 55px; border-radius: 12px; }
.pg-login .brand-logo i { font-size: 45px; color: var(--primary-color); }
.pg-login .app-subtitle { color: #6b7280; font-size: 14px; margin-bottom: 30px; }
.pg-login .error-msg { background: #fee2e2; color: #ef4444; padding: 14px 15px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 25px; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid #fca5a5; }
.pg-login .input-wrapper { position: relative; }
.pg-login .input-wrapper i { position: absolute; top: 50%; transform: translateY(-50%); left: 16px; color: #9ca3af; font-size: 16px; }
.pg-login .forgot-link { text-align: right; margin-top: -10px; margin-bottom: 25px; }
.pg-login .forgot-link a { font-size: 13px; color: var(--primary-color); text-decoration: none; font-weight: 600; transition: 0.2s; }
.pg-login .forgot-link a:hover { text-decoration: underline; }
.pg-login .footer-link { margin-top: 25px; font-size: 14px; color: #6b7280; font-weight: 500; }
.pg-login .footer-link a { color: var(--primary-color); text-decoration: none; font-weight: 600; transition: 0.2s; }
.pg-login .footer-link a:hover { text-decoration: underline; }

/* ---- Register (register.php) — scoped .pg-register ---- */
.pg-register .register-wrapper { width: 100%; max-width: 900px; }
.pg-register .marketing-side { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: white; padding: 50px 40px; width: 50%; display: flex; flex-direction: column; justify-content: center; }
.pg-register .marketing-side h2 { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.pg-register .marketing-side p { font-size: 15px; opacity: 0.9; margin-bottom: 30px; }
.pg-register .benefits-list { list-style: none; padding: 0; }
.pg-register .benefits-list li { margin-bottom: 12px; font-size: 14px; font-weight: 500; background: rgba(255,255,255,0.15); padding: 12px 16px; border-radius: 12px; backdrop-filter: blur(5px); display: flex; align-items: center; gap: 10px; }
.pg-register .form-side { padding: 50px 40px; width: 50%; display: flex; flex-direction: column; justify-content: center; }
.pg-register .app-subtitle { color: #6b7280; font-size: 14px; margin-bottom: 25px; text-align: center; }
.pg-register .alert-box { padding: 14px 15px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 25px; display: flex; align-items: center; gap: 10px; text-align: left; }
.pg-register .alert-error { background: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; }
.pg-register .alert-success { background: #d1fae5; color: #10b981; border: 1px solid #a7f3d0; flex-direction: column; align-items: flex-start; }
.pg-register .alert-success a { color: var(--primary-color); font-weight: 700; text-decoration: underline; margin-top: 5px; display: inline-block; }
.pg-register .input-wrapper { position: relative; }
.pg-register .input-wrapper i { position: absolute; top: 50%; transform: translateY(-50%); left: 16px; color: #9ca3af; font-size: 16px; }
.pg-register .footer-link { margin-top: 25px; font-size: 14px; color: #6b7280; font-weight: 500; text-align: center; }
.pg-register .footer-link a { color: var(--primary-color); text-decoration: none; font-weight: 600; transition: 0.2s; }
.pg-register .footer-link a:hover { text-decoration: underline; }
@media (max-width: 768px) {
    .pg-register .marketing-side, .pg-register .form-side { width: 100%; padding: 40px 25px; }
}

/* ---- Forgot Password (forgot_password.php) — scoped .pg-forgot_password ---- */
.pg-forgot_password .auth-wrapper { width: 100%; max-width: 420px; }
.pg-forgot_password .auth-card { background: #ffffff; padding: 40px 30px; border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.04); text-align: center; border: 1px solid #ffffff; }
.pg-forgot_password .auth-icon { width: 70px; height: 70px; background: var(--primary-light); color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 0 auto 20px auto; }
.pg-forgot_password .auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; color: #111827; }
.pg-forgot_password .auth-card p.sub { font-size: 14px; color: #6b7280; margin-bottom: 20px; line-height: 1.5; }
.pg-forgot_password .input-group { display: flex; align-items: center; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 14px; padding: 0 15px; margin-bottom: 16px; transition: 0.3s; }
.pg-forgot_password .input-group:focus-within { border-color: var(--primary-color); background: #ffffff; box-shadow: 0 0 0 4px var(--primary-light); }
.pg-forgot_password .input-group i { color: #9ca3af; font-size: 18px; }
.pg-forgot_password .app-input { width: 100%; padding: 16px 10px; border: none; background: transparent; outline: none; font-size: 15px; color: #1f2937; }
.pg-forgot_password .otp-channels { text-align: left; margin-bottom: 20px; }
.pg-forgot_password .otp-channels > span.label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.pg-forgot_password .otp-opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid #e5e7eb; border-radius: 14px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.pg-forgot_password .otp-opt:hover { border-color: #cbd5e1; background: #fafafa; }
.pg-forgot_password .otp-opt:has(input:checked) { border-color: var(--primary-color); background: var(--primary-light); }
.pg-forgot_password .otp-opt input { width: 18px; height: 18px; accent-color: var(--primary-color); }
.pg-forgot_password .otp-opt span.text { flex: 1; font-size: 14px; font-weight: 500; color: #334155; }
.pg-forgot_password .otp-opt i.fa-whatsapp { color: #25D366; font-size: 20px; }
.pg-forgot_password .otp-opt i.fa-envelope { color: #64748b; font-size: 18px; }
.pg-forgot_password .wa-hint { font-size: 12px; color: #64748b; text-align: left; margin: -8px 0 16px; line-height: 1.4; }
.pg-forgot_password .auth-footer { margin-top: 30px; font-size: 14px; color: #6b7280; font-weight: 500; }
.pg-forgot_password .auth-footer a { color: var(--primary-color); text-decoration: none; font-weight: 600; transition: 0.2s; }
.pg-forgot_password .auth-footer a:hover { opacity: 0.8; text-decoration: underline; }

/* ---- Reset Password (reset_password.php) — scoped .pg-reset_password ---- */
.pg-reset_password .auth-wrapper { width: 100%; max-width: 420px; }
.pg-reset_password .auth-card { background: #fff; padding: 36px 28px; border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.06); border: 1px solid #fff; text-align: center; }
.pg-reset_password .step-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-color); background: var(--primary-light); padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.pg-reset_password .auth-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: #111827; }
.pg-reset_password .auth-card p.sub { font-size: 14px; color: #6b7280; margin-bottom: 20px; line-height: 1.5; text-align: left; }
.pg-reset_password .app-alert.hint-email { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }
.pg-reset_password .app-alert.hint-wa { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.pg-reset_password .input-group { display: flex; align-items: center; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 14px; padding: 0 15px; margin-bottom: 14px; transition: 0.3s; }
.pg-reset_password .input-group:focus-within { border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.pg-reset_password .input-group i { color: #9ca3af; font-size: 18px; }
.pg-reset_password .app-input { width: 100%; padding: 16px 10px; border: none; background: transparent; outline: none; font-size: 18px; letter-spacing: 0.2em; text-align: center; color: #1f2937; }
.pg-reset_password .app-input.password-field { font-size: 15px; letter-spacing: normal; text-align: left; }
.pg-reset_password .auth-footer { margin-top: 24px; font-size: 14px; color: #6b7280; }
.pg-reset_password .auth-footer a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.pg-reset_password .auth-footer a:hover { text-decoration: underline; }

/* ---- Upgrade Plan (upgrade_plan.php) — scoped .pg-upgrade_plan ---- */
.pg-upgrade_plan .container { max-width: 560px; margin: 0 auto; }
.pg-upgrade_plan .card { background: #fff; border-radius: 20px; padding: 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; margin-bottom: 20px; }
.pg-upgrade_plan .back-link { display: inline-flex; align-items: center; gap: 8px; color: #64748b; text-decoration: none; font-weight: 600; margin-bottom: 20px; }
.pg-upgrade_plan .back-link:hover { color: var(--primary-color); }
.pg-upgrade_plan h1 { font-size: 24px; color: #1e293b; margin-bottom: 8px; }
.pg-upgrade_plan .plan-option { border: 2px solid #e2e8f0; border-radius: 14px; padding: 18px; margin-bottom: 12px; cursor: pointer; transition: 0.2s; }
.pg-upgrade_plan .plan-option:hover, .pg-upgrade_plan .plan-option.selected { border-color: var(--primary-color); background: var(--primary-light); }
.pg-upgrade_plan .plan-option.disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
.pg-upgrade_plan .plan-option.disabled .plan-name { color: #94a3b8; }
.pg-upgrade_plan .plan-option.disabled .plan-badge { font-size: 11px; color: #94a3b8; margin-top: 6px; }
.pg-upgrade_plan .plan-option input { display: none; }
.pg-upgrade_plan .plan-name { font-weight: 700; font-size: 17px; color: #1e293b; }
.pg-upgrade_plan .plan-price { font-size: 14px; color: #64748b; margin-top: 4px; }
.pg-upgrade_plan .plan-feats { font-size: 12px; color: #475569; margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.pg-upgrade_plan .plan-feats span { background: #f1f5f9; padding: 4px 10px; border-radius: 8px; }
.pg-upgrade_plan .upload-area { border: 3px dashed #86efac; background: #f0fdf4; border-radius: 14px; padding: 24px; text-align: center; cursor: pointer; }
.pg-upgrade_plan .upload-area:hover { border-color: var(--primary-color); }
.pg-upgrade_plan .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 28px; border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer; border: none; text-decoration: none; }
.pg-upgrade_plan .btn-primary { background: var(--primary-color); color: white; width: 100%; }
.pg-upgrade_plan .alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; }
.pg-upgrade_plan .alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.pg-upgrade_plan .alert-success { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }

/* ---- Reseller Dashboard (reseller/reseller_dashboard.php) — scoped .pg-reseller_dashboard ---- */
.pg-reseller_dashboard .reseller-stats-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.pg-reseller_dashboard .stat-box { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); color: white; padding: 20px; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); position: relative; overflow: hidden; }
.pg-reseller_dashboard .stat-box::after { content: '\f080'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: -15px; bottom: -15px; font-size: 80px; color: rgba(255,255,255,0.05); transform: rotate(-15deg); }
.pg-reseller_dashboard .stat-box.green { background: linear-gradient(135deg, #047857 0%, #064e3b 100%); }
.pg-reseller_dashboard .stat-box h3 { font-size: 13px; color: #cbd5e1; font-weight: 500; margin-bottom: 5px; }
.pg-reseller_dashboard .stat-box h2 { font-size: 28px; font-weight: 800; display: flex; align-items: baseline; gap: 5px; }
.pg-reseller_dashboard .stat-box h2 span { font-size: 14px; font-weight: 500; color: #94a3b8; }

/* =========================================================================
   Standalone (auth / public) page layout — these are centered-card / landing
   pages, NOT the panel shell. Restore each one's own <body> layout so the
   panel's desktop `body { display:flex }` rule can't shove them to the corner.
   ========================================================================= */
body.pg-login, body.pg-register, body.pg-forgot_password, body.pg-reset_password,
body.pg-payment_pending, body.pg-payment_rejected {
    display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
}
body.pg-payment_pending { background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); }
body.pg-payment_rejected { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); }
body.pg-upgrade_plan { display: block; min-height: 100vh; background: #f1f5f9; padding: 30px 20px; }
body.pg-index { display: block; overflow-x: hidden; background: var(--wa-bg); color: var(--text-dark); }

/* Auth cards reuse the shared .app-card name but are NOT interactive panel
   cards — restore their own look and cancel the panel hover-lift. */
.pg-login .app-card {
    padding: 40px 30px; text-align: center; border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); border: 1px solid #f3f4f6;
}
.pg-register .app-card {
    padding: 0; overflow: hidden; display: flex; flex-direction: row;
    border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); border: 1px solid #f3f4f6;
}
.pg-login .app-card:hover, .pg-register .app-card:hover { transform: none; box-shadow: 0 10px 30px rgba(0,0,0,0.03); border-color: #f3f4f6; }
@media (max-width: 768px) {
    .pg-register .app-card { flex-direction: column; }
}
