/* Inno Panda Chatbot — Tester SaaS dashboard */
:root {
    --ip-tester-sidebar: #0f172a;
    --ip-tester-sidebar-text: #e2e8f0;
    --ip-tester-accent: #4f46e5;
    --ip-tester-accent-hover: #4338ca;
    --ip-tester-bg: #f1f5f9;
    --ip-tester-card: #ffffff;
    --ip-tester-border: #e2e8f0;
    --ip-tester-text: #0f172a;
    --ip-tester-muted: #64748b;
    --ip-tester-radius: 12px;
    --ip-tester-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
}

body.ip-tester-portal-page {
    margin: 0;
    background: var(--ip-tester-bg);
    color: var(--ip-tester-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
}

/* Hide site menu, footer, admin bar, and public chat widget on tester portal */
body.ip-tester-portal-page #wpadminbar,
body.ip-tester-portal-page .site-header,
body.ip-tester-portal-page .site-footer,
body.ip-tester-portal-page #masthead,
body.ip-tester-portal-page #colophon,
body.ip-tester-portal-page .header,
body.ip-tester-portal-page .footer,
body.ip-tester-portal-page .main-header,
body.ip-tester-portal-page .main-footer,
body.ip-tester-portal-page .page-header,
body.ip-tester-portal-page .page-footer,
body.ip-tester-portal-page nav.navigation,
body.ip-tester-portal-page .primary-navigation,
body.ip-tester-portal-page .secondary-navigation,
body.ip-tester-portal-page .top-bar,
body.ip-tester-portal-page .bottom-bar,
body.ip-tester-portal-page .storefront-primary-navigation,
body.ip-tester-portal-page .storefront-handheld-footer-bar,
body.ip-tester-portal-page .woocommerce-store-notice,
body.ip-tester-portal-page #ip-ai-chatbot-button,
body.ip-tester-portal-page [id^="ip-ai-chatbot"] {
    display: none !important;
    visibility: hidden !important;
}

body.ip-tester-portal-page .entry-title,
body.ip-tester-portal-page .page-title,
body.ip-tester-portal-page .wp-block-post-title,
body.ip-tester-portal-page .breadcrumb,
body.ip-tester-portal-page .breadcrumbs,
body.ip-tester-portal-page .woocommerce-breadcrumb {
    display: none !important;
}

body.ip-tester-portal-page .site-content,
body.ip-tester-portal-page #content,
body.ip-tester-portal-page main.site-main,
body.ip-tester-portal-page .content-area {
    max-width: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

body.ip-tester-portal-page .entry-content > *:not(.ip-tester-portal-root):not(.ip-tester-login-wrap):not(.ip-tester-notice) {
    display: none !important;
}

body.ip-tester-portal-page .ip-tester-portal-root,
body.ip-tester-portal-page .ip-tester-login-wrap {
    display: block !important;
}

body.ip-tester-standalone {
    margin: 0;
    padding: 0;
}

body.ip-tester-login-page .entry-title,
body.ip-tester-dashboard-page .entry-title {
    display: none;
}

/* Login */
.ip-tester-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%);
}

.ip-tester-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--ip-tester-card);
    border-radius: var(--ip-tester-radius);
    box-shadow: var(--ip-tester-shadow);
    padding: 32px;
}

.ip-tester-login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.ip-tester-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ip-tester-accent);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
}

.ip-tester-login-form label {
    display: block;
    margin-bottom: 14px;
}

.ip-tester-login-form label span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ip-tester-muted);
}

.ip-tester-login-form input[type="text"],
.ip-tester-login-form input[type="password"],
.ip-tester-input,
.ip-tester-select,
.ip-tester-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--ip-tester-border);
    border-radius: 8px;
    font-size: 15px;
}

.ip-tester-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 16px !important;
}

/* App layout */
.ip-tester-app {
    display: flex;
    min-height: 100vh;
}

.ip-tester-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--ip-tester-sidebar);
    color: var(--ip-tester-sidebar-text);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.2s ease;
}

.ip-tester-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.ip-tester-brand strong {
    display: block;
    font-size: 15px;
}

.ip-tester-brand span {
    font-size: 12px;
    opacity: 0.7;
}

.ip-tester-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.ip-tester-nav-item {
    display: flex;
    font-size: 13px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ip-tester-sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.ip-tester-nav-item:hover,
.ip-tester-nav-item.is-active {
    background: rgba(79, 70, 229, 0.35);
    color: #fff;
}

.ip-tester-main-wrap {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ip-tester-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--ip-tester-card);
    border-bottom: 1px solid var(--ip-tester-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.ip-tester-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--ip-tester-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
}

.ip-tester-page-title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ip-tester-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ip-tester-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ip-tester-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ip-tester-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.ip-tester-content {
    padding: 24px;
    flex: 1;
}

/* Cards & grid */
.ip-tester-card {
    background: var(--ip-tester-card);
    border-radius: var(--ip-tester-radius);
    box-shadow: var(--ip-tester-shadow);
    border: 1px solid var(--ip-tester-border);
    margin-bottom: 20px;
}

.ip-tester-card-pad {
    padding: 20px 24px;
}

.ip-tester-grid {
    display: grid;
    gap: 20px;
}

.ip-tester-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ip-tester-stat-card {
    padding: 20px;
}

.ip-tester-stat-label {
    display: block;
    font-size: 13px;
    color: var(--ip-tester-muted);
    margin-bottom: 8px;
}

.ip-tester-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ip-tester-accent);
}

.ip-tester-stat-sm {
    font-size: 16px !important;
}

.ip-tester-muted {
    color: var(--ip-tester-muted);
    font-size: 14px;
}

/* Buttons */
.ip-tester-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.ip-tester-btn-primary {
    background: var(--ip-tester-accent);
    color: #fff;
}

.ip-tester-btn-primary:hover {
    background: var(--ip-tester-accent-hover);
}

.ip-tester-btn-secondary {
    background: #e2e8f0;
    color: var(--ip-tester-text);
}

.ip-tester-btn-ghost {
    background: transparent;
    color: var(--ip-tester-muted);
    border: 1px solid var(--ip-tester-border);
}

.ip-tester-btn-block {
    width: 100%;
}

.ip-tester-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

/* Alerts */
.ip-tester-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ip-tester-alert-error {
    background: #fef2f2;
    color: #b91c1c;
}

.ip-tester-alert-info {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Split panels */
.ip-tester-split {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.ip-tester-list-panel {
    max-height: 70vh;
    overflow: auto;
}

.ip-tester-conv-list .ip-tester-conv-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ip-tester-border);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.ip-tester-conv-list .ip-tester-conv-item:hover,
.ip-tester-conv-list .ip-tester-conv-item.is-selected {
    background: #f8fafc;
}

.ip-tester-conv-item strong {
    display: block;
    font-size: 14px;
}

.ip-tester-conv-item small {
    color: var(--ip-tester-muted);
    font-size: 12px;
}

.ip-tester-detail-panel {
    min-height: 400px;
    padding: 20px;
}

.ip-tester-msg {
    padding: 10px 0;
    border-bottom: 1px solid var(--ip-tester-border);
    font-size: 14px;
}

.ip-tester-msg-role {
    font-weight: 600;
    font-size: 12px;
    color: var(--ip-tester-muted);
    text-transform: uppercase;
}

/* Toolbar, tabs, table */
.ip-tester-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ip-tester-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ip-tester-border);
}

.ip-tester-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--ip-tester-muted);
}

.ip-tester-tab.is-active {
    color: var(--ip-tester-accent);
    border-bottom-color: var(--ip-tester-accent);
}

.ip-tester-tab-panel {
    display: none;
}

.ip-tester-tab-panel.is-active {
    display: block;
}

.ip-tester-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ip-tester-table th,
.ip-tester-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--ip-tester-border);
}

.ip-tester-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.ip-tester-badge-ok {
    background: #dcfce7;
    color: #166534;
}

.ip-tester-badge-off {
    background: #f1f5f9;
    color: #64748b;
}

.ip-tester-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ip-tester-form-grid .ip-tester-full {
    grid-column: 1 / -1;
}

.ip-tester-code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-size: 12px;
    overflow: auto;
    max-height: 480px;
    margin-top: 16px;
}

.ip-tester-inbox-wrap {
    border-radius: var(--ip-tester-radius);
    overflow: hidden;
    border: 1px solid var(--ip-tester-border);
}

.ip-tester-widget-preview-note {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.ip-tester-url-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ip-tester-url-list li {
    padding: 8px 0;
    word-break: break-all;
}

/* Embedded full plugin admin (iframe) */
.ip-tester-admin-embed-wrap {
    margin: 0;
}

.ip-tester-admin-embed-hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.ip-tester-admin-embed-hint a {
    margin-left: 8px;
    color: var(--ip-tester-accent);
}

.ip-tester-admin-iframe {
    width: 100%;
    min-height: calc(100vh - 140px);
    border: 1px solid var(--ip-tester-border);
    border-radius: var(--ip-tester-radius);
    background: #fff;
}

/* Direct-embedded admin (no iframe) */
.ip-tester-admin-embed-direct .ip-charla-wrap {
    margin: 0;
    box-shadow: none;
    border: 1px solid var(--ip-tester-border);
    border-radius: var(--ip-tester-radius);
    background: #fff;
    overflow: hidden;
}

.ip-tester-admin-embed-direct .ip-charla-main {
    padding: 16px 20px 24px;
    min-height: 480px;
}

.ip-tester-admin-embed-direct .ip-charla-layout {
    display: block;
}

.ip-tester-content .ip-inbox,
.ip-tester-content .ip-charla-wrap .ip-inbox {
    min-height: 400px;
}

body.ip-tester-embed-admin .ip-charla-sidebar {
    display: none;
}

body.ip-tester-embed-admin .ip-charla-main,
body.ip-tester-embed-admin .ip-charla-layout {
    margin-left: 0;
    max-width: 100%;
}

body.ip-tester-embed-admin #wpadminbar,
body.ip-tester-wp-plugin-admin #wpadminbar {
    display: none !important;
}

body.ip-tester-embed-admin #wpbody-content {
    padding-bottom: 0;
}

/* Mobile */
@media (max-width: 900px) {
    .ip-tester-sidebar {
        transform: translateX(-100%);
    }

    .ip-tester-app.ip-tester-sidebar-open .ip-tester-sidebar {
        transform: translateX(0);
    }

    .ip-tester-main-wrap {
        margin-left: 0;
    }

    .ip-tester-menu-toggle {
        display: block;
    }

    .ip-tester-split {
        grid-template-columns: 1fr;
    }

    .ip-tester-form-grid {
        grid-template-columns: 1fr;
    }
}
