/* SitePulse Portal - Plugin-specific styles */
/* Variable aliases: map portal names → theme.css variable names */
:root {
    --sp-text-main: var(--sp-foreground);
    --sp-bg-main: var(--sp-background);
    --sp-bg-card: var(--sp-card);
    --sp-bg-input: var(--sp-input);
    --sp-text-muted: var(--sp-muted-foreground);
    --sp-primary-hover: var(--sp-primary);
    --sp-border-focus: var(--sp-ring);
    --sp-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --sp-error-bg: hsla(0, 72%, 51%, 0.2);
    --sp-error-text: var(--sp-destructive);
    --sp-success-bg: hsla(142, 76%, 36%, 0.2);
    --sp-success-text: var(--sp-success);
}

.sitepulse-portal-wrapper {
    font-family: 'Inter', sans-serif;
    color: var(--sp-text-main);
    background: var(--sp-bg-main);
    min-height: 600px;
    border-radius: var(--sp-radius);
    padding: 40px;
    box-shadow: var(--sp-shadow);
    max-width: 1600px;
    margin: 40px auto;
    border: 1px solid var(--sp-border);
}

.sp-logout {
    color: var(--sp-text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
}

.sp-logout:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* User info area */
.sp-user-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--sp-text-muted);
    font-size: 14px;
}

.sp-refresh {
    color: var(--sp-text-muted);
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sp-refresh:hover {
    color: var(--sp-primary);
    background: rgba(99, 102, 241, 0.1);
}

.sp-refresh .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Navigation */
.sp-container {
    display: block;
}

@media (max-width: 800px) {
    .sp-container {
        flex-direction: column;
    }
}

.sp-nav {
    display: flex;
    flex-direction: column;
    width: 220px;
    flex-shrink: 0;
    gap: 8px;
}

.sp-nav-item {
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    color: var(--sp-text-muted);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 15px;
}

.sp-nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.sp-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--sp-primary);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

/* Content Area */
.sp-content {
    flex-grow: 1;
}

/* WordPress Admin Postbox Overrides */
.postbox {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border) !important;
    border-radius: var(--sp-radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: none !important;
}

.postbox .postbox-header,
.postbox .hndle {
    border-bottom: 1px solid var(--sp-border) !important;
    background: transparent !important;
    color: var(--sp-text-main) !important;
    padding: 10px 0 !important;
}

.postbox .inside {
    padding: 15px 0 !important;
    margin: 0 !important;
    color: var(--sp-text-main);
}

.postbox:hover {
    border-color: var(--sp-border-focus) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.postbox h2,
.postbox h3 {
    margin-top: 0;
    color: white;
    font-weight: 600;
}

/* Site Lists Compact Styles */
.sp-item-list .sp-card {
    padding: 16px;
    margin-bottom: 12px;
}

.sp-item-row {
    margin-bottom: 12px;
}

.sp-item-list h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.sp-item-list p {
    margin: 4px 0;
    font-size: 13px;
}

.sp-site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sp-site-header h3 a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.2s;
}

.sp-site-header h3 a:hover {
    color: var(--sp-primary);
}

.sp-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.sp-status-active {
    background: var(--sp-success-bg);
    color: var(--sp-success-text);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.sp-status-inactive {
    background: var(--sp-error-bg);
    color: var(--sp-error-text);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Portal Badge Color Variants */
.sp-badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.sp-badge-orange {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sp-badge-red {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sp-badge-gray {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.sp-badge-pro {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.15);
}

.sp-site-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .sp-site-details {
        grid-template-columns: 1fr;
    }
}

.sp-site-details p {
    font-size: 13px;
    margin: 4px 0;
}

.sp-site-details strong {
    color: #cbd5e1;
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

/* Buttons */
/* Buttons */
.sp-btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    /* Fix for WP border defaults */
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    height: auto !important;
    line-height: normal !important;
    color: var(--sp-text-main);
    background: rgba(255, 255, 255, 0.05);
    /* Default button bg */
    text-decoration: none !important;
}

.sp-btn:hover,
.button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transform: translateY(-1px);
}

.sp-btn-primary,
.button-primary {
    background: linear-gradient(135deg, var(--sp-primary), var(--sp-primary-hover)) !important;
    color: #09090b !important;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25) !important;
    border: none !important;
}

.sp-btn-primary:hover,
.button-primary:hover {
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--sp-primary-hover), var(--sp-primary)) !important;
}

.sp-btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.sp-btn-secondary {
    background: transparent;
    border: 1px solid var(--sp-border);
    color: var(--sp-text-main);
}

.sp-btn-secondary:hover {
    background: var(--sp-bg-input);
    border-color: var(--sp-primary);
}

.sp-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

.sp-btn-danger:hover {
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* Login Card */
.sitepulse-login-wrapper {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

/* Modern Login Styles */
.sp-my-account-section {
    min-height: 100vh;
    padding: 40px 20px;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        var(--sp-bg-main);
    animation: sp-bg-shift 20s ease-in-out infinite alternate;
}

@keyframes sp-bg-shift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.sp-login-modern .sp-login-card {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 48px 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: sp-card-entrance 0.5s ease-out;
}

@keyframes sp-card-entrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.sp-login-logo {
    margin-bottom: 24px;
}

.sp-login-logo svg {
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
}

/* Header */
.sp-login-modern .sp-login-card h2 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.sp-login-subtitle {
    color: var(--sp-text-muted);
    font-size: 15px;
    margin-bottom: 24px;
}

/* Security Badge */
.sp-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 28px;
    animation: sp-badge-pulse 3s ease-in-out infinite;
}

@keyframes sp-badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
    }
}

/* Messages */
.sp-login-messages:empty {
    display: none;
}

.sp-login-messages {
    background: var(--sp-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--sp-error-text);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}

.sp-login-messages.sp-messages-success {
    background: var(--sp-success-bg);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--sp-success-text);
}

/* Form */
.sp-login-form {
    text-align: left;
}

.sp-form-group {
    margin-bottom: 20px;
}

.sp-form-label {
    display: block;
    color: var(--sp-text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.sp-input-wrapper {
    position: relative;
}

.sp-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sp-text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

.sp-form-input {
    width: 100%;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--sp-border);
    color: white;
    padding: 14px 14px 14px 46px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.sp-form-input::placeholder {
    color: rgba(156, 163, 175, 0.6);
}

.sp-form-input:focus {
    border-color: var(--sp-primary);
    background: rgba(31, 41, 55, 0.8);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.2),
        0 0 20px rgba(99, 102, 241, 0.1);
}

.sp-form-input:focus+.sp-input-icon,
.sp-input-wrapper:focus-within .sp-input-icon {
    color: var(--sp-primary);
}

/* Password Toggle */
.sp-password-wrapper .sp-form-input {
    padding-right: 50px;
}

.sp-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--sp-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-password-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sp-password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--sp-primary);
}

/* Form Options Row */
.sp-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Custom Checkbox */
.sp-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--sp-text-muted);
}

.sp-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sp-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--sp-border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sp-checkbox-wrapper input:checked+.sp-checkbox-custom {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
}

.sp-checkbox-wrapper input:checked+.sp-checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.sp-checkbox-wrapper input:focus+.sp-checkbox-custom {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.sp-checkbox-label {
    color: var(--sp-text-muted);
    transition: color 0.2s;
}

.sp-checkbox-wrapper:hover .sp-checkbox-label {
    color: white;
}

/* Forgot Password Link */
.sp-forgot-link {
    color: var(--sp-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.sp-forgot-link:hover {
    color: #818cf8;
    text-decoration: underline;
}

/* Submit Button */
.sp-btn-submit {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.sp-btn-submit .sp-btn-loader {
    display: none;
}

.sp-btn-submit.sp-loading .sp-btn-text {
    visibility: hidden;
}

.sp-btn-submit.sp-loading .sp-btn-loader {
    display: flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.sp-btn-submit.sp-loading .sp-btn-loader svg {
    animation: sp-spin 1s linear infinite;
}

@keyframes sp-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Success Button */
.sp-btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.25) !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sp-btn-success:hover {
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.4) !important;
    transform: translateY(-1px);
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
}

/* Divider */
.sp-divider {
    position: relative;
    margin: 28px 0;
    border-top: 1px solid var(--sp-border);
}

.sp-divider span {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.9);
    padding: 0 16px;
    color: var(--sp-text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* Register CTA */
.sp-register-cta {
    text-align: center;
    margin-bottom: 28px;
}

.sp-register-cta h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sp-register-cta p {
    color: var(--sp-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Trust Section */
.sp-trust-section {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sp-trust-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.sp-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sp-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.sp-trust-badge svg {
    color: rgba(99, 102, 241, 0.7);
}

/* Responsive */
@media (max-width: 500px) {
    .sp-login-modern .sp-login-card {
        padding: 32px 24px;
    }

    .sp-form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sp-trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* Legacy Login Card Fallback */
.sp-login-card {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.sp-login-card h2 {
    color: white;
    font-size: 24px;
    margin-bottom: 30px;
}

/* WP Login Form Overrides */
.sp-login-card form p {
    margin-bottom: 16px;
}

.sp-login-card label {
    display: block;
    text-align: left;
    color: var(--sp-text-muted);
    font-size: 14px;
    margin-bottom: 4px;
}

.sitepulse-portal-wrapper input[type="text"],
.sitepulse-portal-wrapper input[type="password"],
.sitepulse-portal-wrapper input[type="email"],
.sitepulse-portal-wrapper select,
.sitepulse-portal-wrapper textarea {
    width: 100%;
    background: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.sitepulse-portal-wrapper input:focus,
.sitepulse-portal-wrapper select:focus,
.sitepulse-portal-wrapper textarea:focus {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.sp-login-card input[type="submit"] {
    width: 100%;
    background: white;
    color: black;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.sp-login-card input[type="submit"]:hover {
    background: #e5e7eb;
}


/* Tabs */
/* WP Standard Tabs */
.nav-tab-wrapper {
    border-bottom: 1px solid var(--sp-border) !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.nav-tab {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-bottom: none !important;
    color: var(--sp-text-muted) !important;
    margin-right: 5px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s;
    text-decoration: none !important;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
}

.nav-tab-active,
.nav-tab-active:hover {
    background: var(--sp-bg-card) !important;
    border: 1px solid var(--sp-border) !important;
    border-bottom: 1px solid var(--sp-bg-card) !important;
    margin-bottom: -1px !important;
    color: var(--sp-primary) !important;
}

/* Tables */
.sp-table,
.widefat {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sp-table th,
.widefat thead th,
.widefat tfoot th {
    text-align: left;
    padding: 10px 12px !important;
    color: var(--sp-text-muted) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--sp-border) !important;
    background: rgba(0, 0, 0, 0.2) !important;
}

.sp-table td,
.widefat td {
    padding: 12px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--sp-text-main) !important;
    vertical-align: middle !important;
}

.widefat tbody tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.sp-table code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--sp-accent);
}

/* Empty States */
.sp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--sp-text-muted);
    background: var(--sp-bg-card);
    border-radius: var(--sp-radius);
    border: 1px dashed var(--sp-border);
}

.sp-empty-state::before {
    content: "📭";
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* WordPress-Style Table */
.sp-wp-table-wrap {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    overflow: hidden;
}

.sp-wp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sp-wp-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--sp-text-muted);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--sp-border);
}

/* WordPress Dashboard Grid Layout */
.metabox-holder {
    clear: both;
    margin-top: 20px;
}

.metabox-holder.columns-2:after {
    content: "";
    display: table;
    clear: both;
}

.postbox-container {
    box-sizing: border-box;
}

/* Responsive Grid */
@media only screen and (max-width: 900px) {
    .metabox-holder.columns-2 .postbox-container {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 20px;
    }
}

/* WP Header Styles */
.wp-heading-inline {
    display: inline-block;
    margin-right: 5px;
    font-size: 24px;
    font-weight: 600;
    color: var(--sp-text-main);
    line-height: 1.3;
    margin: 0 0 15px 0;
}

.page-title-action {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--sp-border);
    border-radius: 4px;
    color: var(--sp-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-left: 10px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

.page-title-action:hover {
    background: var(--sp-primary);
    color: white;
    border-color: var(--sp-primary);
}

.wp-header-end {
    display: none;
}


.sp-wp-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

.sp-wp-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.sp-wp-table tbody tr:last-child {
    border-bottom: none;
}

.sp-wp-table td {
    padding: 12px;
    vertical-align: top;
    color: var(--sp-text-main);
}

.sp-wp-table .column-primary {
    font-size: 14px;
}

.sp-wp-table .row-title a {
    color: var(--sp-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.sp-wp-table .row-title a:hover {
    color: #818cf8;
}

.sp-wp-table .row-meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sp-wp-table .row-url {
    font-size: 12px;
    color: var(--sp-text-muted);
}

.sp-wp-table .row-actions {
    visibility: hidden;
    margin-top: 6px;
    font-size: 12px;
}

.sp-wp-table tbody tr:hover .row-actions {
    visibility: visible;
}

.sp-wp-table .row-actions a {
    color: var(--sp-primary);
    text-decoration: none;
}

.sp-wp-table .row-actions a:hover {
    color: #818cf8;
}

.sp-wp-table .row-actions span {
    color: var(--sp-text-muted);
}

/* Status Styles */
.sp-status {
    font-size: 12px;
    font-weight: 500;
}

.sp-status-active {
    color: #22c55e;
}

.sp-status-inactive {
    color: #6b7280;
}

/* Metric Styles */
.sp-metric {
    display: inline-block;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
}

.sp-metric-good {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.sp-metric-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.sp-metric-bad {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sp-metric-neutral {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

/* Version Info */
.sp-version-info {
    display: block;
    font-weight: 500;
    color: var(--sp-text-main);
}

.sp-version-sub {
    display: block;
    font-size: 11px;
    color: var(--sp-text-muted);
    margin-top: 2px;
}

/* License Badges */
.sp-license-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sp-license-pro {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.sp-license-free {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

/* Expiry Styles */
.sp-expiry-ok {
    font-size: 11px;
    color: #22c55e;
    display: block;
    margin-top: 2px;
}

.sp-expiry-warning {
    font-size: 11px;
    color: #f59e0b;
    display: block;
    margin-top: 2px;
}

.sp-expiry-expired {
    font-size: 11px;
    color: #ef4444;
    display: block;
    margin-top: 2px;
}

/* Hosting Badges */
.sp-hosting-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

/* Projects List (SaaS Style) */
.sp-projects-container {
    background: transparent;
    margin-top: 20px;
}

.sp-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sp-projects-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--sp-text-main);
}

.sp-projects-actions {
    display: flex;
    gap: 12px;
}

.sp-projects-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.sp-search-input {
    background: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    width: 300px;
    outline: none;
    transition: all 0.2s;
}

.sp-search-input:focus {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.sp-filter-dropdown {
    color: var(--sp-text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Project Row */
.sp-project-row {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.2s;
}

.sp-project-row:hover {
    border-color: var(--sp-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.sp-col-status {
    width: 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sp-col-status .dashicons {
    font-size: 24px;
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
}

.sp-col-status.up {
    color: #10b981;
}

.sp-col-status.down {
    color: #ef4444;
}

.sp-status-text {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.sp-col-site {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-site-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.sp-site-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-site-name {
    color: var(--sp-text-main);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-site-name:hover {
    color: var(--sp-primary);
}

.sp-site-url {
    color: var(--sp-text-muted);
    font-size: 12px;
    text-decoration: none;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-col-metrics {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sp-col-metrics .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.sp-metric-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-score {
    font-weight: 600;
    font-size: 14px;
}

.sp-metric-sub {
    font-size: 11px;
    color: var(--sp-text-muted);
    margin-left: 22px;
}

.sp-col-updates,
.sp-col-server,
.sp-col-health,
.sp-col-issues {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--sp-text-muted);
}

.sp-text-small {
    white-space: nowrap;
}

.sp-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.sp-pill-red {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sp-pill-neutral {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.sp-col-actions {
    /* width: 100px; */
    text-align: right;
}

.sp-btn-outline {
    background: transparent !important;
    border: 1px solid var(--sp-border) !important;
    color: var(--sp-text-main) !important;
}

.sp-btn-outline:hover {
    border-color: var(--sp-text-muted) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.sp-btn-xs {
    padding: 6px 12px !important;
    font-size: 12px !important;
    height: auto !important;
}

/* Responsive */
@media (max-width: 1000px) {
    .sp-project-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .sp-col-status,
    .sp-col-site,
    .sp-col-actions {
        width: 100%;
        text-align: left;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .sp-col-status {
        flex-direction: row;
        width: auto;
        gap: 8px;
    }

    .sp-col-site {
        flex: 100%;
        margin-bottom: 10px;
    }

    .sp-col-metrics,
    .sp-col-updates,
    .sp-col-server,
    .sp-col-health,
    .sp-col-issues {
        flex: 1 0 40%;
    }
}



.sp-hosting-owned {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.sp-hosting-external {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* ==================== Overview Dashboard Styles ==================== */

/* Stats Grid */
.sp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .sp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .sp-stats-grid {
        grid-template-columns: 1fr;
    }
}

.sp-stat-card {
    background: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.sp-stat-card:hover {
    border-color: var(--sp-border-focus);
    transform: translateY(-2px);
}

.sp-stat-card.sp-stat-warning {
    border-color: rgba(245, 158, 11, 0.5);
}

.sp-stat-card.sp-stat-danger {
    border-color: rgba(239, 68, 68, 0.5);
}

.sp-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.sp-stat-content {
    display: flex;
    flex-direction: column;
}

.sp-stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--sp-text-main);
}

.sp-stat-label {
    font-size: 13px;
    color: var(--sp-text-muted);
    margin-top: 4px;
}

/* Overview Grid */
.sp-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .sp-overview-grid {
        grid-template-columns: 1fr;
    }
}

.sp-overview-card {
    padding: 24px;
}

.sp-overview-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sp-text-main);
}

.sp-overview-card h3 .dashicons {
    color: var(--sp-primary);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Health List */
.sp-health-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-health-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.sp-health-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sp-health-indicator.good {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.sp-health-indicator.warning {
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.sp-health-indicator.danger {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.sp-health-text {
    font-size: 14px;
    color: var(--sp-text-muted);
}

/* Performance Insights */
.sp-insight-block {
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.sp-insight-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sp-text-muted);
    display: block;
    margin-bottom: 8px;
}

.sp-insight-site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sp-insight-link {
    color: var(--sp-text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.sp-insight-link:hover {
    color: var(--sp-primary);
}

.sp-score-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Performance Bars */
.sp-perf-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.sp-perf-bar-item {
    display: grid;
    grid-template-columns: 120px 1fr 30px;
    gap: 12px;
    align-items: center;
}

.sp-perf-bar-label {
    font-size: 12px;
    color: var(--sp-text-muted);
}

.sp-perf-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.sp-perf-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.sp-perf-bar-fill.good {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.sp-perf-bar-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.sp-perf-bar-fill.poor {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.sp-perf-bar-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-text-main);
    text-align: right;
}

/* Infrastructure Stats */
.sp-infra-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sp-infra-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.sp-infra-item.highlight {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sp-infra-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--sp-text-main);
    display: block;
}

.sp-infra-label {
    font-size: 12px;
    color: var(--sp-text-muted);
    margin-top: 4px;
    display: block;
}

/* Quick Actions List */
.sp-quick-actions-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sp-quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    color: var(--sp-text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.sp-quick-action:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--sp-primary);
    color: white;
}

.sp-quick-action .dashicons {
    color: var(--sp-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 900px) {
    .sp-wp-table .row-actions {
        visibility: visible;
    }
}

/* Toggle Switch */
.sp-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.sp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    transition: 0.3s;
    border-radius: 24px;
}

.sp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--sp-text-muted);
    transition: 0.3s;
    border-radius: 50%;
}

.sp-toggle input:checked+.sp-toggle-slider {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
}

.sp-toggle input:checked+.sp-toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}

.sp-toggle input:focus+.sp-toggle-slider {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}