/* 
 * Pexally Email Campaign - Master Admin Stylesheet
 * Handles all UI styling for Dashboard, Campaigns, Contacts, Settings, and Templates.
 */

/* --- General Wrapper & Hero --- */
.pex-admin-wrap { max-width: 1200px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin-top: 20px; }
.pex-hero { padding: 24px 28px; border-radius: 12px; background: linear-gradient(135deg, #0a0a0a 0%, #1a8b44 100%); color: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.08); margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center; }
.pex-hero h1 { margin: 0 0 8px; color: #fff; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.pex-hero p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.88); line-height: 1.5; }
.pex-hero-text h1 { font-size: 28px; }
.pex-hero-text p { max-width: 600px; }

/* --- Cards & Layout --- */
.pex-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); overflow: hidden; margin-bottom: 20px; display: flex; flex-direction: column; }
.pex-card-header { padding: 18px 22px; border-bottom: 1px solid #eef2f7; background: #f8fafc; display: flex; justify-content: space-between; align-items: center; }
.pex-card-header h2 { margin: 0; font-size: 18px; color: #0f172a; font-weight: 600; }
.pex-card-body { padding: 20px 22px; flex-grow: 1; }
.pex-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: start; }
.pex-dashboard-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; }
@media(max-width: 900px) { 
    .pex-grid, .pex-dashboard-layout { grid-template-columns: 1fr; } 
    .pex-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* --- Forms & Inputs --- */
.pex-form-table th { width: 240px; padding-top: 18px; font-weight: 600; vertical-align: top; }
.pex-form-table td { padding-top: 14px; padding-bottom: 14px; vertical-align: top; }
.pex-input { border-radius: 8px; border-color: #cbd5e1; padding: 10px 14px; width: 100%; max-width: 800px; box-shadow: none; outline: none; transition: border-color 0.2s; font-size: 14px; margin-bottom: 10px; }
.pex-input:focus { border-color: #1a8b44; box-shadow: 0 0 0 1px #1a8b44; outline: none; }
p.description { font-size: 13px; color: #64748b; margin-top: 6px; margin-bottom: 0; line-height: 1.5; }

/* --- Buttons --- */
.pex-btn-primary { background: #1a8b44; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; margin-right: 8px; }
.pex-btn-primary:hover { background: #156631; color: #fff; }
.pex-btn-primary:disabled { background: #94a3b8 !important; cursor: not-allowed !important; color: #e2e8f0 !important; }
.pex-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; margin-right: 5px; cursor: pointer; transition: all 0.2s; }
.pex-btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.pex-btn-warning { background: #f59e0b; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; margin-right: 8px; transition: all 0.2s; }
.pex-btn-warning:hover { background: #d97706; color: #fff; }
.pex-btn-danger-solid { background: #ef4444; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; margin-right: 8px; transition: all 0.2s; }
.pex-btn-danger-solid:hover { background: #dc2626; color: #fff; }
.pex-btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; }
.pex-btn-danger:hover { background: #fee2e2; color: #b91c1c; }
.pex-btn-info { background: #3b82f6; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; margin-right: 8px; transition: all 0.2s; }
.pex-btn-info:hover { background: #2563eb; color: #fff; }
.pex-btn-white { background: #fff; color: #1a8b44; padding: 12px 24px; border-radius: 8px; font-weight: 600; text-decoration: none; display: inline-block; transition: all 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.pex-btn-white:hover { background: #f8fafc; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.pex-pw-toggle { background: #ffffff; color: #475569; border: 1px solid #cbd5e1; padding: 0 16px; height: 36px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 80px; transition: all 0.2s ease; }
    
/* --- Data Tables --- */
.pex-data-table { width: 100%; border-collapse: collapse; text-align: left; }
.pex-data-table th { background: #f8fafc; padding: 16px 20px; font-weight: 600; color: #475569; font-size: 13px; text-transform: uppercase; border-bottom: 2px solid #e2e8f0; letter-spacing: 0.5px; }
.pex-data-table td { padding: 18px 20px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; color: #1f2937; font-size: 14px; }
.pex-data-table tr:last-child td { border-bottom: none; }
.pex-data-table tr:hover { background: #f8fafc; }
.pex-action-btn { text-decoration: none; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; margin-right: 6px; border: 1px solid transparent; transition: all 0.2s; }
.pex-action-btn:last-child { margin-right: 0; }
.pex-action-view { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.pex-action-view:hover { background: #e2e8f0; color: #0f172a; }
.pex-action-edit { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pex-action-edit:hover { background: #dbeafe; color: #1e3a8a; }
.pex-action-dup { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.pex-action-dup:hover { background: #fde68a; color: #92400e; }
.pex-action-del { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.pex-action-del:hover { background: #fee2e2; color: #b91c1c; }

/* --- Notices & Badges --- */
.pex-custom-notice { background-color: #dcfce7; border-left: 4px solid #16a34a; padding: 12px 20px; margin-bottom: 20px; border-radius: 4px; color: #166534; font-weight: 600; font-size: 14px; }
.pex-badge { background: #dcfce7; color: #15803d; padding: 4px 10px; border-radius: 50px; font-size: 12px; font-weight: 700; display: inline-block; }
.pex-status-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* --- Dashboard Specific --- */
.pex-filter-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 24px; margin-bottom: 25px; display: flex; align-items: flex-end; gap: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); flex-wrap: wrap; }
.pex-filter-group { display: flex; flex-direction: column; flex-grow: 1; min-width: 150px; }
.pex-filter-group label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.pex-filter-input { padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; color: #0f172a; outline: none; width: 100%; box-shadow: none; }
.pex-filter-input:focus { border-color: #1a8b44; box-shadow: 0 0 0 1px #1a8b44; }
.pex-filter-actions { display: flex; align-items: center; gap: 10px; }
.pex-btn-apply { background: #1a8b44; color: #fff; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.pex-btn-apply:hover { background: #156631; }
.pex-btn-reset { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 9px 16px; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.pex-btn-reset:hover { background: #e2e8f0; color: #0f172a; }

.pex-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 25px; }
@media(max-width: 900px) { .pex-metrics-grid { grid-template-columns: 1fr 1fr; } }
.pex-metric-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); text-align: center; transition: transform 0.2s; }
.pex-metric-card:hover { transform: translateY(-3px); border-color: #1a8b44; box-shadow: 0 10px 15px rgba(0,0,0,0.05); }
.pex-metric-label { font-size: 12px; color: #64748b; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 10px; display: block; }
.pex-metric-value { font-size: 36px; font-weight: 800; line-height: 1; }
.pex-metric-sub { font-size: 13px; color: #94a3b8; margin-top: 8px; display: block; }
.val-contacts { color: #0f172a; } .val-sent { color: #1a8b44; } .val-open { color: #3b82f6; } .val-click { color: #8b5cf6; }

.pex-quick-link { display: flex; align-items: center; padding: 15px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none; color: #334155; font-weight: 600; margin-bottom: 12px; transition: all 0.2s; }
.pex-quick-link:hover { background: #f0fdf4; border-color: #1a8b44; color: #156631; transform: translateX(4px); }
.pex-quick-icon { width: 36px; height: 36px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-size: 18px; }

/* --- Progress & Sending Stats --- */
.pex-progress-wrapper { display: none; margin-top: 20px; }
.pex-progress-bg { background: #e2e8f0; height: 12px; border-radius: 10px; overflow: hidden; width: 100%; }
.pex-progress-bar { background: #1a8b44; height: 100%; width: 0%; transition: width 0.3s ease; }
.pex-progress-text { font-size: 13px; font-weight: 600; color: #0f172a; margin-top: 8px; text-align: center; }
.pex-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pex-status-item { padding: 24px 14px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.pex-status-label { font-size: 11px; color: #64748b; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.pex-status-value { font-size: 32px; font-weight: 700; color: #0f172a; margin-top: 8px; }
.progress-bar-container { background: #e2e8f0; border-radius: 20px; height: 24px; width: 100%; margin-top: 25px; overflow: hidden; display: none; }
.pex-failed-box { margin-top: 15px; padding: 15px; background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; display: none; }
.pex-failed-box textarea { width: 100%; height: 120px; font-size: 13px; color: #b91c1c; background: #fff; border: 1px solid #fca5a5; border-radius: 4px; padding: 8px; }
.pex-quota-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 18px; margin-top: 20px; font-size: 13px; font-weight: 600; color: #334155; display: flex; align-items: center; justify-content: space-between; }
.pex-quota-box span { color: #1a8b44; }

/* --- Settings Mailer Selection --- */
.pex-mailer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; max-width: 800px; margin-bottom: 20px; }
.pex-mailer-option { cursor: pointer; }
.pex-mailer-option input[type="radio"] { display: none; }
.pex-mailer-box { padding: 15px; border: 2px solid #e2e8f0; border-radius: 8px; text-align: center; background: #fff; transition: all 0.2s ease; height: 100%; box-sizing: border-box; }
.pex-mailer-box strong { display: block; font-size: 14px; color: #1e293b; margin-bottom: 5px; }
.pex-mailer-box span { font-size: 12px; color: #64748b; }
.pex-mailer-option input[type="radio"]:checked + .pex-mailer-box { border-color: #1a8b44; background: #f0fdf4; box-shadow: 0 4px 6px rgba(26,139,68,0.1); }
.pex-mailer-google .pex-mailer-box { background: linear-gradient(to bottom right, #f0fdf4, #dcfce7); border: 2px solid #4ade80; }
.pex-mailer-google input[type="radio"]:checked + .pex-mailer-box { border-color: #15803d; box-shadow: 0 6px 16px rgba(21, 128, 61, 0.25); background: linear-gradient(to bottom right, #ecfdf5, #d1fae5); }
.pex-badge-rec { display: inline-block; background: #15803d !important; color: #ffffff !important; font-size: 11px; padding: 5px 12px; border-radius: 50px; margin-top: 8px; text-transform: uppercase; font-weight: 900; letter-spacing: 0.5px; box-shadow: 0 2px 4px rgba(21, 128, 61, 0.3); }
.pex-badge-wp { display: inline-block; background: #f59e0b !important; color: #ffffff !important; font-size: 11px; padding: 4px 10px; border-radius: 50px; margin-top: 8px; text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px; box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2); }
.pex-smtp-fields { transition: opacity 0.3s ease; }

/* --- Contacts Tabs & Modals --- */
.pex-tabs { display: flex; border-bottom: 1px solid #e2e8f0; margin-bottom: 20px; }
.pex-tab { padding: 10px 15px; cursor: pointer; font-weight: 600; color: #64748b; border-bottom: 2px solid transparent; transition: all 0.2s; font-size: 13px; }
.pex-tab.active { color: #1a8b44; border-bottom-color: #1a8b44; }
.pex-tab-content { display: none; }
.pex-tab-content.active { display: block; }

.pex-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); z-index: 99999; align-items: center; justify-content: center; }
.pex-modal { background: #fff; width: 100%; max-width: 500px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); padding: 25px; position: relative; }
.pex-modal h3 { margin-top: 0; color: #0f172a; }
.pex-modal-close { position: absolute; top: 15px; right: 15px; cursor: pointer; font-size: 20px; color: #64748b; background: none; border: none; }

/* --- License Page Specific --- */
.pex-pricing-list { list-style: none; padding: 0; margin: 0; }
.pex-pricing-list li { padding: 12px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; color: #334155; display: flex; align-items: flex-start; }
.pex-pricing-list li:last-child { border-bottom: none; }
.pex-icon-check { color: #1a8b44; margin-right: 10px; font-weight: bold; }
.pex-highlight { color: #1a8b44; font-weight: 700; }

/* --- Templates Grid & CSS Mockups --- */
.pex-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; }
.pex-tpl-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; transition: all 0.3s ease; display: flex; flex-direction: column; box-shadow: 0 4px 6px rgba(0,0,0,0.02); position: relative; }
.pex-tpl-card:hover { transform: translateY(-6px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); border-color: #1a8b44; }
.pex-tpl-badge { position: absolute; top: 15px; right: 15px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 10px; border-radius: 50px; z-index: 10; }
.badge-sales { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-news { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-alert { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-event { background: #faf5ff; color: #b45309; border: 1px solid #fef3c7; }
.badge-general { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.pex-tpl-preview { height: 200px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 20px; }
.m-email { width: 150px; height: 180px; background: #fff; border-radius: 6px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); display: flex; flex-direction: column; padding: 12px; box-sizing: border-box; border: 1px solid #e2e8f0; overflow: hidden; }
.m-head { height: 16px; background: #0f172a; border-radius: 3px; margin-bottom: 12px; flex-shrink: 0; }
.m-hero { height: 45px; background: #cbd5e1; border-radius: 3px; margin-bottom: 12px; flex-shrink: 0; }
.m-title { height: 8px; background: #64748b; border-radius: 4px; margin-bottom: 10px; width: 70%; }
.m-line { height: 4px; background: #e2e8f0; border-radius: 2px; margin-bottom: 6px; width: 100%; }
.m-line.short { width: 60%; margin-bottom: 12px; }
.m-btn { height: 14px; background: #1a8b44; border-radius: 4px; margin-top: auto; margin-bottom: 5px; width: 60%; margin-left: auto; margin-right: auto; flex-shrink: 0; }
.m-grid { display: flex; gap: 6px; margin-bottom: 12px; flex-shrink: 0; }
.m-grid-box { flex: 1; height: 35px; background: #e2e8f0; border-radius: 3px; }
.m-circle { width: 30px; height: 30px; background: #cbd5e1; border-radius: 50%; margin: 0 auto 10px auto; flex-shrink: 0; }

.tpl-minimal .m-head { background: transparent; border-bottom: 2px solid #e2e8f0; margin-bottom: 15px; }
.tpl-promo .m-head { background: #dc2626; }
.tpl-promo .m-hero { background: #fef2f2; border: 1px dashed #fca5a5; }
.tpl-promo .m-btn { background: #dc2626; width: 80%; }
.tpl-ecommerce .m-grid-box { height: 45px; }
.tpl-alert .m-head { background: #f59e0b; }
.tpl-alert .m-title { width: 50%; margin: 0 auto 10px auto; background: #d97706; }
.tpl-holiday .m-head { background: #b91c1c; }
.tpl-holiday .m-hero { background: #fef3c7; }

.pex-tpl-body { padding: 22px; flex-grow: 1; display: flex; flex-direction: column; }
.pex-tpl-body h3 { margin: 0 0 8px 0; font-size: 17px; color: #0f172a; font-weight: 700; }
.pex-tpl-body p { margin: 0 0 20px 0; font-size: 13px; color: #64748b; line-height: 1.6; flex-grow: 1; }
.pex-btn-select { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; text-align: center; text-decoration: none; display: block; transition: all 0.2s; }
.pex-tpl-card:hover .pex-btn-select { background: #1a8b44; color: #fff; border-color: #1a8b44; }

/* Footer Copyright */
.pex-copyright-footer { margin-top: 30px; display: flex; align-items: center; font-size: 14px; color: #64748b; font-weight: 500; }
.pex-copyright-footer img { width: 24px; height: 24px; margin-right: 10px; border-radius: 50%; border: 1px solid #cbd5e1; }