/* PulseGrid Pro — Panel de Ajustes */
body.toplevel_page_pulsegrid #wpcontent {
    background: #f0f2f5;
}

body.toplevel_page_pulsegrid .pg-panel-wrap > .notice {
    border-radius: 8px;
}

.pg-panel-wrap {
    margin: 20px 20px 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.pg-panel-wrap .notice {
    margin: 0 0 16px;
}

.pg-panel-header {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pg-panel-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3498db;
    margin-bottom: 8px;
}

.pg-panel-label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3498db;
}

.pg-panel-header h1 {
    margin: 0 0 4px;
    padding: 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.pg-panel-subtitle {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

.pg-panel-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: start;
}

.pg-panel-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pg-panel-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.toplevel_page_pulsegrid .pg-panel-nav button:focus,
body.toplevel_page_pulsegrid .pg-panel-nav button:active,
body.toplevel_page_pulsegrid .pg-panel-nav button:focus-visible,
body.toplevel_page_pulsegrid .pg-panel-wrap a:focus,
body.toplevel_page_pulsegrid .pg-panel-wrap a:active,
body.toplevel_page_pulsegrid .pg-panel-wrap button:focus,
body.toplevel_page_pulsegrid .pg-panel-wrap button:active {
    outline: none !important;
    box-shadow: none !important;
}

.pg-panel-nav a:focus,
.pg-panel-nav a:active,
.pg-panel-nav .pg-menu-item:focus,
.pg-panel-nav .pg-menu-item:active,
.pg-panel-wrap .pg-panel-footer button:focus,
.pg-panel-wrap .pg-panel-footer button:active {
    outline: none !important;
    box-shadow: none !important;
}

.pg-panel-nav a:focus:not(:focus-visible),
.pg-panel-wrap .pg-panel-footer button:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.pg-menu-group {
    margin-bottom: 4px;
}

.pg-menu-group:not(.is-open) .pg-submenu {
    display: none;
}

.pg-menu-group.is-open > .pg-menu-parent {
    background: #e8f4fc;
    color: #2980b9;
}

button.pg-menu-parent {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pg-menu-parent-label {
    flex: 1;
}

.pg-menu-chevron {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    color: #95a5a6 !important;
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.pg-menu-group.is-open .pg-menu-chevron {
    transform: rotate(0deg);
    color: #3498db !important;
}

.pg-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.pg-menu-item:hover {
    background: #f0f7fc;
    color: #3498db;
}

.pg-menu-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #3498db;
}

.pg-menu-group.is-open > .pg-menu-parent,
.pg-menu-item.is-active {
    background: #e8f4fc;
    color: #2980b9;
}

.pg-submenu {
    list-style: none;
    margin: 4px 0 8px;
    padding: 0 0 0 28px;
    overflow: hidden;
}

.pg-menu-group.is-open .pg-submenu {
    display: block;
}

.pg-submenu li {
    margin: 0;
}

.pg-submenu a {
    display: block;
    padding: 7px 12px;
    border-radius: 6px;
    color: #5a6c7d;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}

.pg-submenu a:hover {
    background: #f5f9fc;
    color: #3498db;
}

.pg-submenu a.is-active {
    background: #3498db;
    color: #fff;
    font-weight: 500;
}

.pg-panel-main {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.pg-breadcrumbs {
    padding: 14px 24px;
    background: #fafbfc;
    border-bottom: 1px solid #eef1f4;
    font-size: 13px;
    color: #95a5a6;
}

.pg-breadcrumbs span {
    color: #3498db;
}

.pg-content-header {
    padding: 24px 24px 0;
}

.pg-content-header h2 {
    margin: 0 0 6px;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
}

.pg-content-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.5;
}

.pg-panel-body {
    padding: 24px;
}

.pg-panel-body .form-table th {
    width: 220px;
    padding: 16px 10px 16px 0;
    font-weight: 600;
    color: #2c3e50;
}

.pg-panel-body .form-table td {
    padding: 16px 10px;
}

.pg-panel-footer {
    padding: 0 24px 24px;
}

.pg-panel-footer .button-primary {
    background: #3498db !important;
    border-color: #2980b9 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    height: auto !important;
    min-height: 40px;
    font-size: 14px !important;
    line-height: 1.4 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px;
    box-shadow: none !important;
    vertical-align: middle;
}

.pg-panel-footer .button-primary:hover {
    background: #2980b9 !important;
    border-color: #2471a3 !important;
}

.pg-panel-footer .button-primary .dashicons {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    margin: 0 !important;
    padding: 0;
    vertical-align: middle;
    position: static;
    top: auto;
}

.pg-panel-footer .button-primary .dashicons::before {
    display: block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
}

/* Admin boxes */
.pulsegrid-admin-box {
    background: #fafbfc;
    border: 1px solid #eef1f4;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.pulsegrid-box-title {
    margin: 0 0 15px;
    padding: 0 0 10px;
    border-bottom: 2px solid #3498db;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.pulsegrid-admin-box .form-table {
    margin-top: 0;
}

.pulsegrid-admin-box .form-table th {
    padding-top: 10px;
}

/* Slider type preview cards */
.pg-slider-type-intro {
    margin: 0 0 16px;
    font-size: 13px;
    color: #646970;
}

.pg-slider-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 960px) {
    .pg-slider-type-grid {
        grid-template-columns: 1fr;
    }
}

.pg-slider-type-option {
    display: block;
    margin: 0;
    cursor: pointer;
}

.pg-slider-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pg-slider-type-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pg-slider-type-option:hover .pg-slider-type-card {
    border-color: #b8d9f0;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.1);
}

.pg-slider-type-option:has(input:checked) .pg-slider-type-card {
    border-color: #3498db;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.18);
}

.pg-slider-type-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid #eef1f4;
}

.pg-slider-type-radio {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid #c3c4c7;
    border-radius: 50%;
    background: #fff;
    position: relative;
}

.pg-slider-type-option:has(input:checked) .pg-slider-type-radio {
    border-color: #3498db;
}

.pg-slider-type-option:has(input:checked) .pg-slider-type-radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #3498db;
}

.pg-slider-type-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pg-slider-type-text strong {
    font-size: 14px;
    color: #2c3e50;
}

.pg-slider-type-desc {
    font-size: 12px;
    line-height: 1.45;
    color: #646970;
    font-weight: 400;
}

.pg-slider-type-preview {
    display: block;
    padding: 10px;
    background: #f4f7fa;
}

.pg-slider-type-preview img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #dde4ea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pg-slider-posts-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 16px;
    padding: 10px 12px;
    background: #e8f4fc;
    border-left: 3px solid #3498db;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #50575e;
}

.pg-slider-posts-note .dashicons {
    flex-shrink: 0;
    margin-top: 1px;
    color: #3498db;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Support section */
.pulsegrid-support-section {
    max-width: none;
}

.pulsegrid-support-header {
    margin-bottom: 24px;
}

.pulsegrid-support-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.support-description {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.pulsegrid-support-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.pulsegrid-support-card {
    background: #fafbfc;
    border-left: 4px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pulsegrid-support-card h3 {
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #2c3e50;
}

.pulsegrid-support-card .dashicons {
    color: #3498db;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.support-card-content p {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.support-card-content .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

.pulsegrid-support-footer {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.pulsegrid-support-footer p {
    margin: 5px 0;
    font-size: 15px;
}

.pulsegrid-support-footer strong {
    font-size: 18px;
}

/* Post selector */
.pulsegrid-selector-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.pulsegrid-available-posts,
.pulsegrid-selected-posts {
    border: 1px solid #eef1f4;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
}

.pulsegrid-available-posts h3,
.pulsegrid-selected-posts h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.pulsegrid-posts-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eef1f4;
    border-radius: 8px;
    padding: 10px;
    background: #fafbfc;
}

.pulsegrid-post-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 6px;
    cursor: move;
}

.pulsegrid-post-item img,
.pulsegrid-no-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.pulsegrid-no-thumb {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.pulsegrid-post-item span {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pulsegrid-post-item button {
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0 !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1 !important;
    border-radius: 4px;
}

.pulsegrid-add-post {
    background: #3498db !important;
    color: #fff !important;
    border-color: #2980b9 !important;
}

.pulsegrid-add-post:hover {
    background: #2980b9 !important;
}

.pulsegrid-remove-post {
    background: #e74c3c !important;
    color: #fff !important;
    border-color: #c0392b !important;
}

#pulsegrid-search-posts {
    width: 100%;
    margin-bottom: 10px;
}

.pulsegrid-sortable .pulsegrid-post-item:hover {
    background: #f0f7fc;
}

.pulsegrid-sortable-placeholder {
    background: #e8f4fc;
    border: 2px dashed #3498db;
    height: 56px;
    margin-bottom: 8px;
}

/* Home sections */
.pulsegrid-home-sections {
    margin-top: 0;
}

.pg-section-heading {
    margin: 24px 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.pulsegrid-info-box {
    background: linear-gradient(135deg, #e8f4fc 0%, #d6eaf8 100%);
    border-left: 5px solid #3498db;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 24px;
}

.pulsegrid-info-box h3 {
    margin-top: 0;
    color: #2980b9;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulsegrid-info-box ul {
    color: #424242;
}

.pulsegrid-section-item {
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.pulsegrid-section-item:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.pulsegrid-section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    background: #fafbfc;
    border-bottom: 1px solid #eef1f4;
    border-radius: 10px 10px 0 0;
}

.pulsegrid-section-header h3 {
    flex: 1;
    margin: 0;
    font-size: 15px;
    color: #2c3e50;
}

.pulsegrid-section-actions {
    display: flex;
    gap: 5px;
}

.pulsegrid-section-actions button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px;
    min-height: 32px;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1 !important;
}

.pg-add-section-btn {
    margin-top: 20px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px !important;
    line-height: 1.4 !important;
    background: #3498db !important;
    border-color: #2980b9 !important;
    border-radius: 8px !important;
}

.pg-add-section-btn .dashicons {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    margin: 0 !important;
    padding: 0;
    vertical-align: middle;
    position: static;
    top: auto;
}

.pg-add-section-btn .dashicons::before {
    display: block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
}

.pulsegrid-section-content {
    padding: 18px;
}

.pulsegrid-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.pulsegrid-switch-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulsegrid-switch-label {
    font-size: 14px;
    line-height: 1.4;
    color: #2c3e50;
    font-weight: 500;
}

.pulsegrid-admin-box .pulsegrid-switch-field + .description,
.form-table .pulsegrid-switch-field + .description {
    margin-top: 8px;
}

.pg-input-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f6f7f7;
}

.pulsegrid-toggle-switch input:focus-visible + .pulsegrid-toggle-slider {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(52, 152, 219, 0.45);
}

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

.pulsegrid-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.pulsegrid-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.4s;
    border-radius: 50%;
}

.pulsegrid-toggle-switch input:checked + .pulsegrid-toggle-slider {
    background-color: #3498db;
}

.pulsegrid-toggle-switch input:checked + .pulsegrid-toggle-slider:before {
    transform: translateX(26px);
}

.pg-add-section-btn:hover {
    background: #2980b9 !important;
    border-color: #2471a3 !important;
}

/* Panel buttons with dashicons — override WP admin defaults */
.pg-panel-wrap .button:has(.dashicons) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    vertical-align: middle;
}

.pg-panel-wrap .button .dashicons {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    margin: 0 !important;
    padding: 0;
    vertical-align: middle;
    position: static;
    top: auto;
}

.pg-panel-wrap .button .dashicons::before {
    display: block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
}

@media (max-width: 1024px) {
    .pg-panel-layout {
        grid-template-columns: 1fr;
    }

    .pulsegrid-support-grid,
    .pulsegrid-selector-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    .pg-panel-wrap {
        margin-right: 10px;
    }

    .pg-panel-body .form-table th,
    .pg-panel-body .form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
}
