/* Engage360 Frontend Dashboard */

.engage360-dashboard-wrap,
.engage360-content-library,
.engage360-my-sites,
.engage360-profile,
.engage360-settings {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.engage360-dashboard-header,
.engage360-library-header,
.engage360-sites-header,
.engage360-profile-header {
    margin-bottom: 30px;
}

.engage360-dashboard-header h1,
.engage360-library-header h1,
.engage360-sites-header h1,
.engage360-profile-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.engage360-dashboard-header p,
.engage360-library-header p,
.engage360-sites-header p,
.engage360-profile-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.engage360-dashboard-date {
    font-size: 14px !important;
    color: #999 !important;
}

/* Stats Grid */
.engage360-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.engage360-stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.engage360-stat-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px;
}

/* Usage List */
.engage360-usage-list {
    margin-bottom: 16px;
}

.engage360-usage-item {
    margin-bottom: 16px;
}

.engage360-usage-item:last-child {
    margin-bottom: 0;
}

.engage360-usage-label {
    font-size: 13px;
    color: #000;
    margin-bottom: 4px;
}

.engage360-usage-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.engage360-usage-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.engage360-usage-fill {
    height: 100%;
    background: linear-gradient(0deg,#00466d 0%,#006a91 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.engage360-usage-numbers {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 45px;
    text-align: right;
}

.engage360-reset-date {
    font-size: 12px;
    color: #999;
    margin: 8px 0 0;
}

/* Upcoming List */
.engage360-upcoming-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.engage360-upcoming-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.engage360-upcoming-list li:last-child {
    border-bottom: none;
}

.engage360-schedule-date {
    font-size: 12px;
    color: #999;
}

/* Big Number */
.engage360-big-number {
    font-size: 48px;
    font-weight: 700;
    color: #00466d;
    line-height: 1;
    margin-bottom: 8px;
}

/* Content Types */
.engage360-content-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.engage360-content-type--blog { background: #dbeafe; color: #1e40af; }
.engage360-content-type--social { background: #fce7f3; color: #be185d; }
.engage360-content-type--newsletter { background: #fef3c7; color: #92400e; }
.engage360-content-type--video { background: #e0e7ff; color: #3730a3; }
.engage360-content-type--guidebook { background: #d1fae5; color: #065f46; }
.engage360-content-type--quiz { background: #ede9fe; color: #5b21b6; }

/* Quick Actions */
.engage360-quick-actions {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.engage360-quick-actions h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
}

.engage360-action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.engage360-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.engage360-btn--primary {
    background: #00466d;
    color: white;
}

.engage360-btn--primary:hover {
    background: #00466d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.engage360-btn--secondary {
    background: white;
    color: #00466d;
    border: 2px solid #00466d;
}

.engage360-btn--secondary:hover {
    background: #00466d;
    color: #fff;
}

.engage360-btn--small {
    padding: 8px 16px;
    font-size: 13px;
}

.engage360-link {
    color: #00466d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.engage360-link:hover {
    text-decoration: underline;
}

/* Recent Activity */
.engage360-recent-activity {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.engage360-recent-activity h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
}

.engage360-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.engage360-activity-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.engage360-activity-list li:last-child {
    border-bottom: none;
}

.engage360-activity-time {
    font-size: 12px;
    color: #999;
    min-width: 100px;
}

.engage360-activity-desc {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Content Library */
.engage360-library-filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.engage360-filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.engage360-filter-form select,
.engage360-filter-form input[type="search"] {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.engage360-filter-form select:focus,
.engage360-filter-form input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Content Grid */
.engage360-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.engage360-content-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.engage360-content-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.engage360-content-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.engage360-content-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.engage360-content-body {
    padding: 20px;
}

.engage360-content-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0 12px;
    color: #1a1a1a;
}

.engage360-content-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px;
}

.engage360-content-actions {
    display: flex;
    gap: 8px;
}

/* My Sites */
.engage360-sites-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.engage360-site-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #e0e0e0;
}

.engage360-site-card--success {
    border-left-color: #10b981;
}

.engage360-site-card--error {
    border-left-color: #ef4444;
}

.engage360-site-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.engage360-site-status {
    font-size: 12px;
    font-weight: 600;
}

.engage360-site-status--success { color: #10b981; }
.engage360-site-status--error { color: #ef4444; }

.engage360-site-url {
    font-size: 14px;
    color: #666;
    margin: 0 0 4px;
}

.engage360-site-meta {
    font-size: 12px;
    color: #999;
    margin: 0;
}

.engage360-add-site {
    margin-top: 24px;
    text-align: center;
}

/* Profile Form */
.engage360-form {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.engage360-form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e0e0e0;
}

.engage360-form-section:last-of-type {
    border-bottom: none;
}

.engage360-form-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #1a1a1a;
}

.engage360-field {
    margin-bottom: 20px;
}

.engage360-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.engage360-field input[type="text"],
.engage360-field input[type="email"],
.engage360-field input[type="url"],
.engage360-field input[type="tel"],
.engage360-field select,
.engage360-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

.engage360-field input:focus,
.engage360-field select:focus,
.engage360-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.engage360-form-row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Empty State */
.engage360-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.engage360-empty-state p {
    font-size: 16px;
    margin-bottom: 16px;
}

/* Notice */
.engage360-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.engage360-notice--success {
    background: #d1fae5;
    color: #065f46;
}

.engage360-notice--error {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 968px) {
    .engage360-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .engage360-action-buttons {
        flex-direction: column;
    }
    
    .engage360-content-grid {
        grid-template-columns: 1fr;
    }
    
    .engage360-site-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .engage360-form-row--half {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Advisor Profile Page
   ========================================================================== */

.engage360-profile-wrap { max-width: 860px; margin: 0 auto; }

/* ---- Header ---- */
.ep-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.ep-header-text h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; color: #1d2327; }
.ep-header-text p  { margin: 0; color: #50575e; font-size: 15px; }

/* ---- Completion Badge ---- */
.ep-completion-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 90px;
}
.ep-completion-ring {
    position: relative;
    width: 72px;
    height: 72px;
}
.ep-completion-ring svg { width: 100%; height: 100%; }
.ep-completion-ring circle:last-child { transition: stroke-dasharray 0.5s ease; }
.ep-completion-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
}
.ep-completion-label { font-size: 12px; color: #757575; text-align: center; }

.ep-completion-badge.complete  circle:last-child { stroke: #16a34a; }
.ep-completion-badge.complete  .ep-completion-pct { color: #16a34a; }
.ep-completion-badge.partial   circle:last-child { stroke: #d97706; }
.ep-completion-badge.partial   .ep-completion-pct { color: #d97706; }
.ep-completion-badge.low       circle:last-child { stroke: #dc2626; }
.ep-completion-badge.low       .ep-completion-pct { color: #dc2626; }

/* ---- Missing fields notice ---- */
.ep-missing-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #78350f;
}
.ep-missing-notice strong { display: block; margin-bottom: 10px; }
.ep-token-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ep-token-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-family: monospace;
    font-weight: 600;
}
.ep-token-ok      { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.ep-token-missing { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.ep-complete-notice {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #166534;
    font-weight: 500;
}

/* ---- Save notice ---- */
#ep-save-notice { margin-bottom: 20px; }

/* ---- Section cards ---- */
.ep-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 24px;
    overflow: hidden;
}
.ep-section-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f0f0f1;
    background: #f9fafb;
}
.ep-section-header h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: #1d2327; }
.ep-section-header p  { margin: 0; font-size: 13px; color: #6b7280; }
.ep-section-header code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}
.ep-section-body { padding: 24px; }

/* ---- Fields ---- */
.ep-field { margin-bottom: 18px; }
.ep-field:last-child { margin-bottom: 0; }

.ep-field > label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.ep-field--missing > label::after {
    content: 'Required for token';
    font-size: 11px;
    font-weight: 500;
    color: #dc2626;
    background: #fee2e2;
    padding: 1px 6px;
    border-radius: 10px;
}
.ep-token-hint {
    font-size: 11px;
    font-family: monospace;
    color: #2271b1;
    background: #f0f6fc;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #c3d9ed;
    font-weight: 400;
}
.ep-field-note {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}
.ep-field-note-inline {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.ep-field input[type="text"],
.ep-field input[type="url"],
.ep-field input[type="tel"],
.ep-field input[type="email"],
.ep-field input[type="number"],
.ep-field textarea,
.ep-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1d2327;
    background: #fff;
    transition: border-color 0.15s;
}
.ep-field input:focus,
.ep-field textarea:focus,
.ep-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.15);
    outline: none;
}
.ep-field--missing input,
.ep-field--missing textarea {
    border-color: #fca5a5;
    background: #fff9f9;
}
.ep-field--missing input:focus,
.ep-field--missing textarea:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220,38,38,.1);
}

.ep-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}
.ep-field-row .ep-field { margin-bottom: 0; }
.ep-field--grow { grid-column: 1 / -1; }
.ep-field--150 { max-width: 160px; }

/* Brand color picker */
.ep-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.ep-color-input {
    width: 44px;
    height: 44px;
    padding: 2px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}
.ep-color-hex {
    width: 100px;
    font-family: monospace;
    font-size: 14px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
}
.ep-color-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    transition: background .2s;
}
.ep-field-hint { margin: 6px 0 0; font-size: 12px; color: #9ca3af; }

/* ---- Headshot + Logo areas ---- */
.ep-headshot-area, .ep-logo-area {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.ep-headshot-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}
.ep-headshot-placeholder { text-align: center; font-size: 28px; }
.ep-logo-preview {
    width: 100px;
    height: 60px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    flex-shrink: 0;
}
.ep-logo-placeholder { font-size: 24px; }
.ep-headshot-actions, .ep-logo-area > div { display: flex; flex-direction: column; gap: 8px; }

/* ---- Specializations checkboxes ---- */
.ep-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.ep-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s;
}
.ep-checkbox-item:hover { border-color: #2271b1; background: #f0f6fc; }
.ep-checkbox-item input[type="checkbox"] { flex-shrink: 0; }

/* ---- Save row ---- */
.ep-save-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0 8px;
}
.ep-status-ok  { color: #16a34a; font-size: 13px; font-weight: 600; }
.ep-status-err { color: #dc2626; font-size: 13px; font-weight: 600; }

/* ---- Button sizes ---- */
.engage360-btn--large {
    padding: 12px 28px !important;
    font-size: 15px !important;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .ep-header { flex-direction: column; }
    .ep-completion-badge { flex-direction: row; min-width: auto; }
    .ep-field-row { grid-template-columns: 1fr; }
    .ep-checkbox-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Email preview tab panels ── */
.ap-email-preview-wrap {
    padding: 20px;
    max-width: 660px;
}
.ap-email-preview-note {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ap-email-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.ap-email-badge--default { background: #fef3c7; color: #92400e; }
.ap-email-badge--custom  { background: #d1fae5; color: #065f46; }
.ap-email-mockup {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ap-em-chrome {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ap-em-row { font-size: 13px; color: #374151; line-height: 1.5; }
.ap-em-label {
    font-weight: 600;
    color: #6b7280;
    display: inline-block;
    min-width: 56px;
}
.ap-em-body {
    padding: 20px 16px;
    font-size: 14px;
    line-height: 1.85;
    color: #111827;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 100px;
}
.ap-email-token {
    display: inline;
    background: #fef3c7;
    color: #92400e;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
}

/* ── Funnel bar email buttons & divider ── */
.ap-funnel-divider {
    color: #d1d5db;
    font-size: 16px;
    margin: 0 4px;
    user-select: none;
}
.ap-funnel-btn--email {
    background: #f0f4ff;
    border-color: #c7d2fe;
    color: #4338ca;
}
.ap-funnel-btn--email:hover { background: #e0e7ff; border-color: #a5b4fc; }
.ap-funnel-btn--email.active { background: #4338ca; border-color: #4338ca; color: #fff; }

/* ── Inline email panel (replaces iframe when active) ── */
.ap-inline-email-panel {
    padding: 20px;
    max-width: 660px;
}
.ap-inline-email-inner { }

/* ── Persistent toolbar (stays visible across email/iframe tab switches) ── */
.ap-toolbar-persistent {
    border-bottom: 1px solid #e5e7eb;
}

/* ── Email body paragraph spacing ── */
.ap-em-body p {
    margin: 0 0 10px;
    line-height: 1.6;
}
.ap-em-body p:last-child { margin-bottom: 0; }

/* ── Combined email tab ── */
.ap-email-section-heading {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px;
    padding: 0;
}
.ap-em-body p {
    margin: 0 0 8px;
    line-height: 1.6;
}
.ap-em-body p:last-child { margin-bottom: 0; }
