/**
 * Block Registry Admin Styles
 * Consolidated styles for the Block Registry module admin pages:
 * - index (blocks list)
 * - categories
 * - edit (block definition editing)
 * - edit_data (block data editing)
 */

/* ==========================================================================
   Shared / Common
   ========================================================================== */

.alert { padding: 15px; margin-bottom: 20px; border-radius: 4px; }
.alert-success { background: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }
.alert-info { background: #d9edf7; color: #31708f; border: 1px solid #bce8f1; }
.alert-warning { background: #fcf8e3; color: #8a6d3b; border: 1px solid #faebcc; }
.alert-error { background: #f2dede; color: #a94442; border: 1px solid #ebccd1; }

/* Toast notification for inline status updates */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast-notification.show { opacity: 1; transform: translateX(0); }
.toast-notification--success { background: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }
.toast-notification--info { background: #d9edf7; color: #31708f; border: 1px solid #bce8f1; }
.toast-notification--error { background: #f2dede; color: #a94442; border: 1px solid #ebccd1; }

.actions { white-space: nowrap; }
.actions form { margin: 0; display: inline !important; float: none !important; width: auto !important; }

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    color: #337ab7;
    font-size: 14px;
}
.btn-link.error { color: #d9534f; }

.btn-small { padding: 6px 12px; font-size: 12px; }

/* Sidebar action buttons (BEM scoped to override admin .btn) */
.sidebar-box .sidebar-box__btn {
    display: block;
    float: none;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    color: #fff;
    font-size: 1.1em;
    font-family: "OpenSansSemibold";
    line-height: 31px;
    height: auto;
}
.sidebar-box .sidebar-box__btn + .sidebar-box__btn { margin-top: 10px; }
.sidebar-box .sidebar-box__btn--primary { background: #007bff; }
.sidebar-box .sidebar-box__btn--success { background: #28a745; }
.sidebar-box .sidebar-box__btn--secondary { background: #6c757d; }
.sidebar-box .sidebar-box__btn--danger { background: #dc3545; margin-top: 20px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state i { color: #ccc; margin-bottom: 20px; }

.required { color: #dc3545; }


/* ==========================================================================
   Index Page — Blocks List
   ========================================================================== */

.block-registry-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 3px;
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toolbar-left label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin: 0;
}
.toolbar-left select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    min-width: 180px;
}
.block-count {
    font-size: 13px;
    color: #666;
    margin-left: 5px;
}

.sortable {
    cursor: pointer;
    user-select: none;
}
.sortable:hover {
    background: #e9ecef;
}
.sortable .fa {
    margin-left: 4px;
    color: #999;
    font-size: 12px;
}
.sortable.asc .fa:before { content: "\f0de"; }
.sortable.desc .fa:before { content: "\f0dd"; }

.category-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    background: #e8f4fd;
    color: #31708f;
}
.category-tag.uncategorized {
    background: #f0f0f0;
    color: #999;
}
.category-tag .fa {
    margin-right: 4px;
    font-size: 11px;
}

.label {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
}
.label-success { background: #5cb85c; color: #fff; }
.label-default { background: #999; color: #fff; }

tr.hidden-row { display: none; }

/* Status toggle buttons (index + global pages) */
.manage-items .toggleStatusBtn {
    display: inline-block;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    border: none;
    cursor: pointer;
    line-height: normal;
}
.manage-items .toggleStatusBtn--published,
.manage-items .toggleStatusBtn--active { background: #5cb85c; }
.manage-items .toggleStatusBtn--draft,
.manage-items .toggleStatusBtn--inactive { background: #999; }


/* ==========================================================================
   Categories Page
   ========================================================================== */

.category-management {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    width: 100%;
}
.category-management fieldset.show {
    float: none !important;
    width: 100% !important;
}
.category-management form.style {
    float: none !important;
    width: 100% !important;
    overflow: hidden;
    padding: 20px;
    margin-top: 10px;
}
.category-management form.style .btn {
    margin-top: 10px;
}
.category-management .row {
    float: none !important;
    clear: both;
    margin-bottom: 20px;
}
.category-management .row label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.category-management .row input[type="text"],
.category-management .row input[type="number"] {
    float: none !important;
    width: 100% !important;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
}
.category-management .row small {
    display: block !important;
    float: none !important;
    clear: both;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}
.category-management .actions form {
    margin: 0;
    display: inline !important;
    float: none !important;
    width: auto !important;
}

.badge {
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}
.modal-footer .btn { margin-left: 10px; }

/* Clickable stat value */
.stat-value--link {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}
.stat-value--link:hover {
    color: #0056b3;
}

/* Instances modal table */
#instancesModalBody .instances-table {
    width: 100%;
    border-collapse: collapse;
}
#instancesModalBody .instances-table th,
#instancesModalBody .instances-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
#instancesModalBody .instances-table th {
    font-weight: 600;
    background: #f8f9fa;
}
#instancesModalBody .instances-table .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}
#instancesModalBody .instances-table .tag-green {
    background: #d4edda;
    color: #155724;
}
#instancesModalBody .instances-table .tag-yellow {
    background: #fff3cd;
    color: #856404;
}

@media (max-width: 900px) {
    .form-columns {
        flex-direction: column;
    }
    .form-sidebar {
        width: 100%;
        position: static;
    }
}


/* ==========================================================================
   Edit Page — Block Definition
   ========================================================================== */

/* Active checkbox */
.active-checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    width: auto !important;
    float: none !important;
    cursor: pointer;
}
.active-checkbox-label input[type="checkbox"] {
    margin: 0 !important;
    width: auto !important;
    float: none !important;
}

.stats-list { list-style: none; margin: 0; padding: 0; }
.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}
.stats-list li:last-child { border-bottom: none; }
.stat-value { font-weight: bold; }

/* Fields section */
.fields-section { padding: 15px; background: #f9f9f9; overflow: hidden; }
.fields-list { margin-bottom: 0; }
.fields-actions { padding-top: 10px; clear: both; }
.field-item {
    background: none;
    border: none;
    margin-bottom: 10px;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
}
.field-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #eee;
    cursor: pointer;
}
.field-drag { cursor: grab; margin-right: 10px; color: #999; }
.field-drag:active { cursor: grabbing; }
.field-item.dragging { opacity: 0.5; border: 2px dashed #007bff; }
.field-item.drag-over { border-top: 3px solid #007bff; }
.field-title { flex: 1; font-weight: bold; }
.field-type-badge {
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 10px;
}
.btn-remove-field {
    background: none;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-size: 16px;
}
.field-item.collapsed .field-body { display: none; }
.field-item.collapsed .field-header { border-radius: 4px; }
.field-body { padding: 15px; background: #fff; }
.field-row { margin-bottom: 12px; }
.field-row label { display: block; margin-bottom: 4px; font-weight: 500; position: relative; }
.field-row label .hint { display: inline-block !important; width: auto !important; float: none !important; clear: none !important; margin-left: 5px; vertical-align: middle; cursor: help; position: relative; }
.field-row label .hint .text { width: 300px; position: absolute; top: -5px; left: 20px; display: none; z-index: 100; background: #0F55C4; color: #fff; padding: 10px; border-radius: 5px; font-weight: normal; }
.field-row label .hint:hover .text { display: block; }
.field-row input[type="text"],
.field-row textarea,
.field-row select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.field-row textarea { height: 60px; resize: vertical; }
.inline-checkboxes label { display: inline-flex; align-items: center; gap: 5px; font-weight: normal; }
.inline-checkboxes small { color: #666; margin-left: 5px; }

.template-table { width: 100%; border-collapse: collapse; max-height: 300px; }
.template-table thead th {
    text-align: left;
    padding: 8px 10px;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    font-size: 12px;
    font-weight: 600;
}
.template-table tbody tr { border-bottom: 1px solid #eee; }
.template-table tbody tr:hover { background: #f9f9f9; }
.template-table tbody tr.is-assigned { background: #e8f5e9; }
.template-table tbody td { padding: 8px 10px; }
.template-table .checkbox-cell { width: 40px; text-align: center; }
.template-table .hint { position: relative; display: inline-block; margin-left: 4px; cursor: help; }
.template-table .hint .text { width: 280px; position: absolute; top: -5px; right: 20px; left: auto; display: none; z-index: 100; background: #0F55C4; color: #fff; padding: 10px; border-radius: 5px; font-weight: normal; text-transform: none; letter-spacing: normal; }
.template-table .hint:hover .text { display: block; }
.template-group-header td {
    padding: 10px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.help-text { color: #666; margin-bottom: 15px; }

/* Image field settings */
.image-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
}
.image-settings-header {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.crop-settings-detail {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin-top: 10px;
}
.image-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.image-settings-grid .field-row { margin-bottom: 0; }
.image-settings-grid input,
.image-settings-grid select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* Conditional visibility settings */
.visibility-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
}
.visibility-settings-header {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.visibility-values-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}
.visibility-values-checkboxes label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* Repeater field settings (edit page) */
.repeater-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
}
.repeater-settings-header {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.repeater-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 15px;
    margin-bottom: 15px;
}
.repeater-settings-row .field-row { margin-bottom: 0; }

.sub-fields-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
}
.sub-fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 13px;
}
.btn-add-subfield {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}
.btn-add-subfield:hover { background: #218838; }

.sub-fields-list { min-height: 30px; }
.sub-field-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    margin-bottom: 8px;
    border-radius: 4px;
}
.sub-field-item:last-child { margin-bottom: 0; }
.sub-field-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #eee;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
}
.sub-field-item.collapsed .sub-field-header {
    border-radius: 4px;
}
.sub-field-drag {
    cursor: grab;
    margin-right: 10px;
    color: #999;
}
.sub-field-drag:active { cursor: grabbing; }
.sub-field-title {
    flex: 1;
    font-weight: bold;
}
.sub-field-type-badge {
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 10px;
}
.btn-remove-subfield {
    background: none;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-size: 16px;
}
.btn-remove-subfield:hover { color: #c9302c; }
.sub-field-body {
    padding: 15px;
}
.sub-field-item.collapsed .sub-field-body {
    display: none;
}
.sub-field-body .field-row { margin-bottom: 12px; }
.sub-field-body .field-row:last-child { margin-bottom: 0; }
.sub-field-body .field-row label { display: block; margin-bottom: 4px; font-weight: 500; }
.sub-field-body .field-row input[type="text"],
.sub-field-body .field-row textarea,
.sub-field-body .field-row select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}
.sub-field-body .field-row textarea { height: 60px; resize: vertical; }
.sub-field-body .inline-checkboxes label { display: inline-flex; align-items: center; gap: 5px; font-weight: normal; }


/* ==========================================================================
   Edit Data Page
   ========================================================================== */

/* Layout */
.form-columns { display: flex; gap: 30px; }
.form-main { flex: 1; min-width: 0; }
.form-sidebar { width: 280px; position: sticky; top: 20px; align-self: flex-start; }

/* Sidebar */
.sidebar-box {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
}
.sidebar-box h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.info-list li:last-child { border-bottom: none; }
.info-label { color: #666; }
.info-value { font-weight: 500; }

.status-box { background: #fff8e1; border-color: #ffecb3; }
.status-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    margin-bottom: 8px;
}
.status-hint { display: block; color: #666; font-size: 12px; }

/* Block description */
.block-description {
    color: #666;
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* Form fields */
.block-data-form .row { margin-bottom: 16px; }
.block-data-form .row label { display: block; margin-bottom: 4px; font-weight: 500; }
.block-data-form .row input[type="text"],
.block-data-form .row input[type="number"],
.block-data-form .row input[type="email"],
.block-data-form .row input[type="url"],
.block-data-form .row input[type="date"],
.block-data-form .row textarea,
.block-data-form .row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}
.block-data-form .row textarea { resize: vertical; min-height: 100px; }
.block-data-form .row textarea.wysiwyg { min-height: 200px; }
.block-data-form .repeater-field { border: none; background: none; }
.block-data-form .repeater-rows { padding: 0; }
.block-data-form .repeater-subfield .image-field-wrapper { background: none; border: none; padding: 0; }
.block-data-form .repeater-subfield .image-field-wrapper .crop-controls { width: 100%; }
.block-data-form .repeater-subfield .image-preview { margin-top: 5px; }
.block-data-form .repeater-subfield .alt-text-field { margin-top: 5px; }

.field-info { display: block; margin-top: 4px; color: #666; font-size: 12px; }

.color-field-wrapper { display: flex; align-items: center; gap: 8px; }
.color-field-wrapper input[type="color"] { width: 40px; height: 40px; padding: 2px; border: 1px solid #ccc; border-radius: 3px; cursor: pointer; flex-shrink: 0; }
.color-field-wrapper input[type="text"] { width: 100px; padding: 10px; border: 1px solid #ccc; border-radius: 3px; font-size: 14px; font-family: monospace; }

.checkbox-wrapper { display: flex; align-items: center; gap: 8px; }
.checkbox-wrapper input[type="checkbox"] { width: auto; }
.checkbox-label { font-weight: normal; margin-bottom: 0; }

.file-field { display: flex; gap: 10px; }
.file-field input { flex: 1; }

.image-preview img { border: 1px solid #ddd; border-radius: 4px; padding: 4px; background: #fff; }

.no-fields { color: #666; font-style: italic; padding: 20px; text-align: center; }

/* Crop Container */
.crop-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    background: #f9f9f9;
}
.crop-controls {
    display: flex;
    align-items: center;
    padding: 8px 0;
}
.crop-image-wrapper {
    max-height: 400px;
    overflow: hidden;
    background: #333;
    border-radius: 4px;
}
.crop-target {
    display: block;
    max-width: 100%;
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}
.preview-section.no-template {
    background: #f9f9f9;
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}
.preview-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.preview-header h2 i { margin-right: 8px; color: #666; }
.preview-header h2 small {
    font-weight: normal;
    color: #888;
    font-size: 12px;
    margin-left: 10px;
}
.preview-actions { display: flex; gap: 8px; }
.preview-actions .btn { padding: 6px 12px; font-size: 13px; }
.preview-container {
    padding: 20px;
}
.preview-frame {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background: #fafafa;
}
.preview-iframe {
    width: 100%;
    min-height: 300px;
    border: none;
    display: block;
}
.preview-note {
    margin: 15px 0 0 0;
    padding: 10px 15px;
    background: #e7f3ff;
    border-radius: 4px;
    font-size: 13px;
    color: #0066cc;
}
.preview-note i { margin-right: 6px; }
.preview-note a { color: #0066cc; text-decoration: underline; }
.preview-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}
.preview-empty i {
    font-size: 32px;
    color: #f0ad4e;
    margin-bottom: 15px;
}
.preview-empty p { margin: 0 0 10px 0; }
.preview-empty small { color: #999; }

/* Repeater Fields */
.field-repeater {
    display: block;
}
.field-repeater > label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.repeater-field {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    clear: both;
}
.repeater-rows {
    padding: 10px;
    min-height: 50px;
}
.repeater-row {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}
.repeater-row:last-child { margin-bottom: 0; }
.repeater-row-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 4px 4px 0 0;
}
.repeater-row-drag {
    cursor: grab;
    color: #999;
    padding: 0 8px 0 0;
}
.repeater-row-drag:active {
    cursor: grabbing;
}
.repeater-row.dragging {
    opacity: 0.5;
    border: 2px dashed #007bff;
}
.repeater-row.drag-over {
    border-top: 3px solid #007bff;
}
.repeater-row-number {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
    color: #555;
}
.btn-remove-row {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
}
.btn-remove-row:hover { color: #c82333; }
.repeater-row-fields {
    padding: 15px;
}
.repeater-subfield {
    margin-bottom: 12px;
}
.repeater-subfield:last-child {
    margin-bottom: 0;
}
.repeater-subfield label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}
.repeater-subfield input[type="text"],
.repeater-subfield textarea,
.repeater-subfield select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}
.repeater-subfield textarea { resize: vertical; min-height: 60px; }
.repeater-subfield .image-field-wrapper {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
}
.repeater-subfield .file-field { display: flex; gap: 5px; width: 100%; }
.repeater-subfield .file-field input { flex: 1; }
.repeater-subfield .alt-text-field {
    margin-top: 8px;
}
.repeater-subfield .alt-text-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
}
.repeater-subfield .alt-text-field input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    box-sizing: border-box;
}
.repeater-subfield .image-preview {
    margin-top: 8px;
}
.repeater-subfield .image-preview img {
    max-width: 100px;
    max-height: 80px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px;
}
.btn-add-row {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    font-size: 14px;
}
.btn-add-row:hover { background: #218838; }
.btn-add-row:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.repeater-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}


/* ==========================================================================
   Entity Blocks (Page Editor)
   Scoped under .entityBlocksFieldset to override admin base styles
   ========================================================================== */

.entityBlocksFieldset .entityBlocksList { padding: 15px; }

.entityBlocksFieldset .entity-blocks-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    margin: 0 -15px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.entityBlocksFieldset .btn-add-block {
    display: inline-block;
    float: none;
    background: #28a745 !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    min-width: 0;
    height: auto;
    line-height: normal;
}

.entityBlocksFieldset .btn-preview {
    display: inline-block;
    float: none;
    background: #17a2b8 !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    min-width: 0;
    height: auto;
    line-height: normal;
}

.entityBlocksFieldset .entityBlocksTable { width: 100%; border-collapse: collapse; }
.entityBlocksFieldset .entityBlocksTable thead tr { background: #f5f5f5; text-align: left; }
.entityBlocksFieldset .entityBlocksTable th { padding: 10px; border-bottom: 2px solid #ddd; }
.entityBlocksFieldset .entityBlocksTable th.col-handle,
.entityBlocksFieldset .entityBlocksTable th.col-num { width: 40px; }
.entityBlocksFieldset .entityBlocksTable th.col-status { width: 90px; }
.entityBlocksFieldset .entityBlocksTable th.col-actions { width: 150px; }
.entityBlocksFieldset .entityBlocksTable tbody tr { border-bottom: 1px solid #eee; }
.entityBlocksFieldset .entityBlocksTable td { padding: 10px; }

.entityBlocksFieldset .entity-block-row--draft { opacity: 0.55; }

.entityBlocksFieldset .drag-handle { cursor: grab; }
.entityBlocksFieldset .drag-handle .fa { color: #999; }

.entityBlocksFieldset .entity-block-num { color: #999; font-weight: 500; }

.entityBlocksFieldset .entity-block-icon { color: #666; margin-right: 8px; }

.entityBlocksFieldset .entity-block-snippet {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

.entityBlocksFieldset .entity-block-category { color: #666; }

.entityBlocksFieldset .toggleStatusBtn {
    display: inline-block;
    float: none;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 3px;
    font-size: 11px;
    border: none;
    cursor: pointer;
    min-width: 0;
    height: auto;
    line-height: normal;
}
.entityBlocksFieldset .toggleStatusBtn--published { background: #28a745 !important; }
.entityBlocksFieldset .toggleStatusBtn--draft { background: #6c757d !important; }

.entityBlocksFieldset .btn-edit-data {
    display: inline-block;
    float: none;
    background: #007bff !important;
    color: #fff !important;
    padding: 5px 12px !important;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    margin-right: 5px;
    min-width: 0;
    height: auto;
    line-height: normal;
}

.entityBlocksFieldset .btn-remove-block {
    display: inline-block;
    float: none;
    background: #dc3545 !important;
    color: #fff !important;
    padding: 5px 12px !important;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    min-width: 0;
    height: auto;
    line-height: normal;
}

.entityBlocksFieldset .entity-blocks-empty { color: #666; text-align: center; padding: 20px; }
.entityBlocksFieldset .entity-blocks-empty span { font-size: 12px; }

.entityBlocksFieldset .badge {
    display: inline-block;
    float: none;
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 10px;
}

.sortable-ghost {
    background: #e3f2fd !important;
    opacity: 0.8;
}
.entityBlocksFieldset .drag-handle:hover {
    background: #f0f0f0;
}
.entityBlocksFieldset .drag-handle:active {
    cursor: grabbing;
}


/* ==========================================================================
   Edit Data Page — Crop & Image Styles
   ========================================================================== */

.alt-text-field { margin-top: 16px; }

.crop-controls { margin-top: 12px; }
.crop-info { font-size: 12px; color: #666; }
.crop-info--sm { font-size: 11px; color: #666; }
.crop-warning {
    margin-top: 8px;
    color: #c0392b;
    font-size: 12px;
    font-weight: bold;
}
.crop-warning--sm {
    margin-top: 4px;
    color: #c0392b;
    font-size: 11px;
    font-weight: bold;
}
.crop-container { margin-top: 12px; }
.crop-target { display: block; max-width: 100%; }

.image-preview { margin-top: 10px; }
.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

.btn-reset-crop { margin-left: 8px; }

.form-hidden { display: none; }


/* ==========================================================================
   Block Preview — Draft Overlay
   ========================================================================== */

.block-draft-overlay {
    position: relative;
    opacity: 0.55;
    border: 2px dashed #6c757d;
}
.block-draft-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #6c757d;
    color: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    z-index: 100;
    letter-spacing: 0.5px;
}


/* ==========================================================================
   Global Blocks — Synced Patterns
   ========================================================================== */

.entity-block-row--global {
    background: #f0faf0 !important;
}
.entity-block-row--global:hover {
    background: #e3f5e3 !important;
}

.entity-block-global-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.entityBlocksFieldset .btn-edit-data--global {
    background: #28a745 !important;
}

.block-picker-global-group {
    border-top: 2px solid #28a745;
    padding-top: 15px;
    margin-top: 10px;
}

.block-picker-item--global {
    border-color: #c3e6cb;
    background: #f0faf0;
}
.block-picker-item--global:hover {
    border-color: #28a745;
    background: #e3f5e3;
}

.sidebar-box--global {
    border: 1px solid #28a745;
    background: #f0faf0;
}
.sidebar-box--global h3 {
    color: #28a745;
}


/* ==========================================================================
   Preview Image Field
   ========================================================================== */

.preview-image-field {
    padding: 15px;
}

.preview-image-thumb {
    margin-top: 10px;
}
.preview-image-thumb img {
    max-width: 300px;
    max-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

.preview-image-field .preview-image-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    clear: both !important;
    width: 100%;
}
.preview-image-field .preview-image-actions .btn {
    display: block;
    width: auto;
    float: none !important;
    align-self: flex-start;
}

/* Entity block name hover preview indicator */
.entity-block-name-wrap[data-preview-url] {
    cursor: pointer;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 2px;
}
.entity-block-name-wrap[data-preview-url]:hover {
    border-bottom-color: #007bff;
}

/* Block Preview Tooltip — live iframe (hover in block picker) */
.block-preview-tooltip {
    position: fixed;
    z-index: 100001;
    width: 420px;
    height: 262px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 6px;
    pointer-events: none;
    overflow: hidden;
}
.block-preview-iframe-wrap {
    width: 420px;
    height: 250px;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
}
.block-preview-iframe-wrap iframe {
    width: 1280px;
    height: 800px;
    transform: scale(0.328125);
    transform-origin: top left;
    pointer-events: none;
    border: none;
}


/* ==========================================================================
   Block Picker Dialog
   Shared styles for the block picker used in CMS page editor and
   standalone entity pages (products, categories).
   ========================================================================== */

/* Block picker component */
.block-picker { min-height: 300px; }
.block-picker-header { display: flex; gap: 10px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #ddd; }
.block-picker-search { flex: 1; }
.block-picker-search input { width: 100%; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.block-picker-filter select { padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; min-width: 150px; }
.block-picker-content { max-height: 400px; overflow-y: auto; }
.block-picker-loading { text-align: center; padding: 40px; color: #666; }
.block-picker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.block-picker-item { border: 1px solid #ddd; border-radius: 6px; padding: 15px; cursor: pointer; transition: all 0.2s; background: #fff; }
.block-picker-item:hover { border-color: #007bff; background: #f8f9ff; }
.block-picker-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.block-picker-item-icon { width: 32px; height: 32px; background: #eee; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #666; }
.block-picker-item-name { font-weight: bold; flex: 1; }
.block-picker-item-badge { font-size: 11px; background: #6c757d; color: #fff; padding: 2px 6px; border-radius: 3px; }
.block-picker-item-desc { font-size: 12px; color: #666; margin-bottom: 5px; }
.block-picker-item-meta { font-size: 11px; color: #999; }
.block-picker-empty { text-align: center; padding: 40px; color: #999; }
.block-picker-empty .fa { margin-bottom: 10px; display: block; }
.block-picker-category-group { margin-bottom: 20px; }
.block-picker-category-title { font-size: 14px; font-weight: bold; color: #333; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #eee; }

/* Global block overrides in picker */
.block-picker-item--global .block-picker-item-icon { background: #e8f5e9; color: #28a745; }
.block-picker-item--global .block-picker-item-badge { background: #28a745; }
.block-picker-global-group .block-picker-category-title { color: #28a745; border-bottom-color: #28a745; }

/* Standalone dialog chrome (products, categories) */
.block-registry-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.block-registry-dialog {
    background: #fff;
    border-radius: 8px;
    width: 700px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.block-registry-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ddd;
}
.block-registry-dialog-header h3 { margin: 0; font-size: 18px; }
.block-registry-dialog-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}
.block-registry-dialog-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ─── Block Template Edit ─── */

.block-template-editor-wrap {
    clear: both;
}
.block-template-editor {
    display: flex;
    gap: 16px;
    min-height: 380px;
    width: 100%;
}
.block-template-available,
.block-template-selected {
    flex: 1;
    min-width: 0;
    border: 1px solid #d7dce4;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.block-template-available h3,
.block-template-selected h3 {
    margin: 0;
    padding: 10px 14px;
    background: #edf0f2;
    border-bottom: 1px solid #d7dce4;
    font-size: 13px;
    font-family: 'OpenSansSemibold', 'Open Sans', sans-serif;
    color: #323234;
    display: flex;
    align-items: center;
    gap: 8px;
}
.block-template-selected h3 .badge {
    font-size: 11px;
    min-width: 20px;
    text-align: center;
}
.block-template-search {
    padding: 8px 10px;
    border-bottom: 1px solid #edf0f2;
    background: #fafbfc;
}
.block-template-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d7dce4;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    box-sizing: border-box;
}
.block-template-search input:focus {
    border-color: #0f55c4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 85, 196, 0.15);
}
.block-template-available-list {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}
.block-template-category-header {
    padding: 6px 12px;
    background: #f5f6f8;
    font-family: 'OpenSansSemibold', 'Open Sans', sans-serif;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #edf0f2;
}
.block-template-available-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
    font-size: 13px;
    color: #323234;
}
.block-template-available-item:hover {
    background: #e8f0fe;
}
.block-template-available-item.is-selected {
    background: #f5f6f8;
    opacity: 0.45;
    pointer-events: none;
}
.block-template-available-item i.fa {
    color: #0f55c4;
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}
.block-template-available-item span {
    flex: 1;
    font-size: 13px;
}
.block-template-add-btn {
    background: none;
    border: none;
    color: #2ecc71;
    cursor: pointer;
    font-size: 15px;
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.block-template-available-item:hover .block-template-add-btn {
    opacity: 1;
}
.block-template-selected-list {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
    min-height: 80px;
}
.block-template-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
    background: #fff;
    font-size: 13px;
    color: #323234;
    transition: background 0.1s;
}
.block-template-selected-item:hover {
    background: #fafbfc;
}
.block-template-selected-item .drag-handle {
    cursor: grab;
    color: #b7babc;
    padding: 0 4px;
    flex-shrink: 0;
}
.block-template-selected-item .drag-handle:hover {
    color: #666;
}
.block-template-selected-item .drag-handle i.fa {
    color: inherit;
}
.block-template-selected-item i.fa {
    color: #0f55c4;
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}
.block-template-selected-name {
    flex: 1;
    font-size: 13px;
}
.block-template-remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    opacity: 0.4;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.block-template-remove-btn:hover {
    opacity: 1;
}
.block-template-empty-msg {
    color: #6b7280;
    text-align: center;
    padding: 40px 15px;
    font-size: 13px;
}
.block-template-empty-msg i.fa {
    color: #b7babc;
    margin-right: 4px;
}
.block-template-selected-item.sortable-ghost {
    opacity: 0.4;
    background: #e8f0fe;
}
/* ─── Global block styling (matches #28a745 convention used elsewhere) ─── */
.block-template-category-header--global {
    color: #28a745;
    border-top: 2px solid #28a745;
    border-bottom: 1px solid #c3e6cb;
    margin-top: 10px;
    padding-top: 12px;
}
.block-template-category-header--global i.fa {
    color: #28a745;
}
.block-template-available-item--global {
    background: #f0faf0;
}
.block-template-available-item--global:hover {
    background: #e3f5e3;
}
.block-template-available-item--global i.fa {
    color: #28a745;
}
.block-template-available-item--global.is-selected {
    background: #eaf3ea;
}
.block-template-selected-item.is-global {
    background: #f0faf0;
}
.block-template-selected-item.is-global:hover {
    background: #e3f5e3;
}
.block-template-selected-item.is-global i.fa {
    color: #28a745;
}
.block-template-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.3px;
    color: #fff;
    background: #28a745;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    text-transform: uppercase;
}
.block-template-type-badge i.fa {
    color: inherit;
    font-size: 11px;
    width: auto;
}
.block-template-type-badge--available {
    opacity: 0.85;
}
.block-template-item-meta {
    color: #8b8e91;
    font-size: 11px;
    margin-left: 4px;
    flex-shrink: 0;
}

/* ─── Template Picker (entity blocks) ─── */

.template-picker {
    min-height: 100px;
}
.template-picker-loading,
.template-picker-empty {
    text-align: center;
    padding: 30px;
    color: #999;
}
.template-picker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.template-picker-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    transition: border-color 0.15s;
}
.template-picker-item:hover {
    border-color: #2563eb;
}
.template-picker-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.template-picker-item-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}
.template-picker-item-count {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}
.template-picker-item-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}
.template-picker-item-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.template-picker-block-tag {
    font-size: 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 3px 8px;
    border-radius: 4px;
    color: #555;
}
.template-picker-block-tag i {
    margin-right: 3px;
    color: #888;
}
.template-picker-apply-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}
.template-picker-apply-btn:hover {
    background: #218838;
}

/* Add Template button styling */
.add-template-from-registry-btn {
    background: #2563eb !important;
}
.add-template-from-registry-btn:hover {
    background: #1d4ed8 !important;
}

/* ==========================================================================
   Link Field
   ========================================================================== */

.link-field-wrapper { display: inline-block; width: 100%; }

.link-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    max-width: 100%;
}
.link-display-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.link-display-url {
    color: #0073aa;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    text-decoration: none;
}
.link-display-url:hover { text-decoration: underline; }
.link-display-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.link-action {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 2px 4px;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
}
.link-action:hover { color: #0073aa; }
.link-action--danger:hover { color: #c0392b; }

/* Link Picker Modal */
.link-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.link-picker-modal {
    background: #fff;
    border-radius: 6px;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.link-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #ddd;
}
.link-picker-header h3 { margin: 0; font-size: 16px; }
.link-picker-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0 4px;
}
.link-picker-close:hover { color: #333; }
.link-picker-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    padding: 0 18px;
    gap: 0;
    background: #fafafa;
}
.link-picker-tab {
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.link-picker-tab:hover {
    color: #333;
}
.link-picker-tab.is-active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: #fff;
}
.link-picker-tab .fa {
    margin-right: 3px;
}
.link-picker-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
}
.link-picker-pane {}
.link-picker-field { margin-bottom: 12px; }
.link-picker-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    float: none !important;
    width: auto !important;
}
.link-picker-field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    float: none !important;
}
.link-picker-checkbox label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.link-picker-checkbox input[type="checkbox"] {
    width: auto;
    float: none !important;
}
.link-picker-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-top: 6px;
}
.link-picker-table {
    width: 100%;
    border-collapse: collapse;
}
.link-picker-result {
    cursor: pointer;
}
.link-picker-result:hover {
    background: #f0f6fb;
}
.link-picker-result td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.link-picker-result-title {
    color: #0073aa;
    font-weight: 500;
}
.link-picker-result-url {
    text-align: right;
    color: #999;
    font-size: 11px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-picker-no-results {
    padding: 12px;
    color: #888;
    font-size: 13px;
    text-align: center;
}
.link-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #ddd;
}
.link-picker-footer .btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}
.link-picker-footer .btn-primary:hover {
    background: #005a87;
}

/* ==========================================================================
   Sync Page
   ========================================================================== */

/* Sync buttons — own class to avoid the admin .btn float/block issues.
   The admin LESS compiles at runtime AFTER static CSS, so we cannot
   reliably override .btn. Instead we use our own .sync-btn class. */
.sync-btn {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-family: "OpenSansSemibold", sans-serif;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    background: #888;
    line-height: 1.4;
    vertical-align: middle;
}
.sync-btn--grey { background: #777; }
.sync-btn--grey:hover { background: #555; }
.sync-btn--green { background: #449d44; }
.sync-btn--green:hover { background: #398439; }
.sync-btn--yellow { background: #ec971f; }
.sync-btn--yellow:hover { background: #d58512; }

/* Toolbar right-side actions */
.toolbar-right {
    float: right;
}

/* Diff expandable rows */
.diff-row { display: none; }
.diff-row.is-expanded { display: table-row; }
.diff-content {
    padding: 15px;
    background: #f8f9fa;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
}
.diff-content .diff-section { margin-bottom: 12px; }
.diff-content .diff-section-title { font-weight: 700; color: #555; margin-bottom: 4px; }
.diff-content .diff-added { color: #3c763d; }
.diff-content .diff-removed { color: #a94442; }
.diff-content .diff-changed { color: #8a6d3b; }
.diff-content .diff-detail { padding-left: 16px; }

/* ==========================================================================
   Icon Picker
   ========================================================================== */

/* Icon Field Wrapper */
.icon-field-wrapper {
    display: flex;
    gap: 5px;
    align-items: center;
}
.icon-field-preview {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 20px;
    flex-shrink: 0;
    background: #f9f9f9;
}
.icon-field-input {
    flex: 1;
}

/* Icon Picker Modal */
.icon-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-picker-modal {
    background: #fff;
    border-radius: 6px;
    width: 700px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.icon-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #ddd;
}
.icon-picker-header h3 { margin: 0; font-size: 16px; }
.icon-picker-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0 4px;
}
.icon-picker-close:hover { color: #333; }

.icon-picker-search {
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
}
.icon-picker-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}
.icon-picker-search input:focus {
    border-color: #337ab7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(51,122,183,0.15);
}

.icon-picker-styles {
    display: flex;
    gap: 0;
    padding: 0 18px;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
}
.icon-picker-style-btn {
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.icon-picker-style-btn:hover { color: #333; }
.icon-picker-style-btn.is-active {
    color: #337ab7;
    border-bottom-color: #337ab7;
    font-weight: 600;
}
.icon-picker-style-btn i {
    margin-right: 4px;
    font-size: 14px;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
    max-height: 400px;
}
.icon-picker-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px 6px;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background 0.1s, border-color 0.1s;
}
.icon-picker-cell:hover {
    background: #f0f7ff;
    border-color: #337ab7;
}
.icon-picker-cell i {
    font-size: 22px;
    margin-bottom: 6px;
    color: #333;
}
.icon-picker-cell span {
    font-size: 10px;
    color: #888;
    word-break: break-all;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.icon-picker-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.icon-picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-top: 1px solid #ddd;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
}
.icon-picker-count {
    font-size: 12px;
    color: #888;
}

/* Custom site icons in picker */
.icon-picker-cell--custom .icon {
    --color: #333;
    --size: 24px;
}
.icon-field-preview .icon {
    --color: #333;
    --size: 20px;
}

/* Multi-region admin UI */
.entityBlocksList--multiRegion {
    clear: both;
}
.entityBlocksList--multiRegion .entityBlocksRegion {
    clear: both;
    margin-bottom: 32px;
    padding-top: 8px;
    border-top: 1px solid #e6e6e6;
}
.entityBlocksList--multiRegion .entityBlocksRegion:first-child {
    border-top: none;
    padding-top: 0;
}
.entityBlocksRegion__heading {
    width: 100%;
    clear: both;
    float: none;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}
.entityBlocksRegion__heading .badge {
    background: #e6e6e6;
    color: #333;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Save as Global Block modal */
#saveAsGlobalModal .modal-body p {
    margin: 0 0 16px;
    color: #555;
}
#saveAsGlobalModal .save-as-global-field {
    display: block;
    width: 100%;
}
#saveAsGlobalModal .save-as-global-field label {
    display: block;
    width: 100%;
    float: none;
    margin: 0 0 6px;
    padding: 0;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
#saveAsGlobalModal .save-as-global-field input[type="text"] {
    display: block;
    width: 100%;
    float: none;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}
#saveAsGlobalModal .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
#saveAsGlobalModal .btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    color: #fff;
}
