.im-license-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* Dropdown and Loader */
.im-license-selector {
    margin-bottom: 8px;
    display: block;
    width: 100%;
}

.im-license-dropdown {
    width: 100%;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    box-shadow: none;
    font-size: 12px;
}

.im-used-limit {
    margin: 8px 0;
    font-size: 13px;
    font-weight: 500;
}

.im-license-table th,
.im-license-table td {
    padding: 8px 10px;
    font-size: 13px;
}

.im-license-table th {
    background: #f9f9f9;
}

.im-deactivate-license {
    background: #ef4444 !important;
    border: none !important;
    color: #fff !important;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.im-deactivate-license:hover {
    background: #dc2626 !important;
}

.im-loader {
    margin-top: 10px;
    font-style: italic;
    text-align: center;
}

/* Filters uniform sizing */
.im-license-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.im-license-filters .im-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.im-filter-select {
    width: 200px;
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 12px;
}

/* Select2 smaller font size when used */
.select2-container .select2-selection--single .select2-selection__rendered {
    font-size: 12px;
}
.select2-container .select2-results__option {
    font-size: 12px;
}

.im-license-details-container {
    background: #ffffff;
    border: 1px solid #e6eef8;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(2,6,23,0.03);
}

/* Action buttons unified look */
.im-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.im-action-btn .im-icon { width:16px; height:16px; display:inline-block; }

.im-action-btn.im-deactivate-license-btn { background: #ef4444; color:#fff; }
.im-action-btn.im-deactivate-license-btn:hover { background:#dc2626; }

.im-action-btn.im-toggle-blacklist-add { background: #f59e0b; color:#fff; }
.im-action-btn.im-toggle-blacklist-remove { background: #6b7280; color:#fff; }

.im-action-label { display:inline-block; }

/* Compact layout for table action column */
.im-license-table td .im-action-btn { margin-right:6px; }

/* Dashicon sizing inside action buttons */
.im-action-btn .dashicons {
    font-size: 14px;
    line-height: 1;
    vertical-align: middle;
}

/* Spinner shown during processing for action buttons */
.im-action-spinner {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0 auto;
    transform-origin: 50% 50%;
    animation: im-spin 1s linear infinite;
}

@keyframes im-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Overlay spinner positioned above button content */
.im-action-spinner-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    z-index: 3;
    animation: im-spin 1s linear infinite;
    color: inherit;
}

/* Dim the underlying button content while loading */
.im-btn-loading :not(.im-action-spinner-overlay) {
    opacity: 0.35;
    transition: opacity 0.12s linear;
}

.im-action-btn .im-action-label {
    display: none; /* show icon-only to keep action column compact */
}

/* Reset filters button */
.im-reset-filters {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.im-reset-filters:hover { background:#1e40af; }

.im-reset-filters:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* ================================
   LICENSE USAGE SUMMARY SECTION
================================ */

.im-all-license-usage {
    background: #f9fbff;
    border: 1px solid #d8e3f3;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    box-shadow: none;
}

.im-all-license-usage h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.im-license-summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.im-license-summary-item {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.im-license-summary-item:hover {
    background: #fff;
}

/* Deactivate button (small) */
.im-deactivate-license-btn {
    background: #ef4444;
    border: none;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}

.im-deactivate-license-btn:hover {
    background: #dc2626;
}

.im-deactivate-license-btn:active {
    transform: scale(0.97);
}

.im-deactivate-license-btn .dashicons {
    font-size: 14px;
    line-height: 1;
}

/* ================================
   Product Name + License Key
================================ */

.im-license-summary-key {
    font-size: 13px;
    color: #1e3a8a;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 260px;
}

.im-license-subkey {
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 500;
    word-break: break-all;
}

/* ================================
   USED / SITE ACCESS LIMIT BLOCK
================================ */

.im-license-summary-usage {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 120px;
}

.im-used-limit-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 13px;
    color: #374151;
}

.im-used-limit-label {
    font-weight: 600;
    color: #1e3a8a;
}

.im-used-limit-values {
    display: flex;
    align-items: center;
    gap: 8px;
}

.im-used-limit-values span {
    font-weight: 600;
    color: #111827;
    min-width: 50px;
    text-align: right;
}

/* Progress Bar */
.im-usage-bar {
    position: relative;
    background: #e5e7eb;
    border-radius: 4px;
    height: 6px;
    width: 70px;
    overflow: hidden;
}

.im-usage-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

/* Status Badges */
.im-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.3;
}

.im-status-active {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.im-status-deactive {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Blacklist Badges */
.im-blacklist-yes {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.im-blacklist-no {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    background: #ecfccb;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

/* Toggle Blacklist Button */
.im-toggle-blacklist-btn {
    background: #f59e0b;
    border: none;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.im-toggle-blacklist-btn[data-action="remove"] {
    background: #6b7280; /* gray for remove */
}

.im-toggle-blacklist-btn:hover {
    transform: translateY(-1px);
}

.im-toggle-blacklist-btn:active {
    transform: scale(0.98);
}

/* ================================
   Responsive
================================ */

@media (max-width: 600px) {
    .im-license-summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .im-license-summary-usage,
    .im-used-limit-block {
        align-items: flex-start;
    }

    .im-used-limit-values span {
        text-align: left;
    }
}

/* =============== CUSTOM DOWNLOAD SECTION =============== */
.im-download-section {
    background: #f9fbff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 24px;
    max-width: 750px;
    margin: 0 auto 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.im-download-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.im-download-header {
    text-align: center;
}

.im-download-title {
    font-size: 20px;
    color: #1d4ed8;
    margin: 0;
    font-weight: 700;
}

.im-download-subtitle {
    font-size: 14px;
    color: #475569;
    margin-top: 4px;
}

.im-download-body {
    text-align: center;
}

.im-download-btn {
    background: #2563eb;
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.im-download-btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.im-download-btn .dashicons {
    font-size: 16px;
}

/* Notes Section */
.im-download-note {
    /*margin-top: 20px;*/
    text-align: left;
    background: #f1f5f9;
    padding: 14px 16px;
    border-radius: 8px;
}

.im-download-note h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #1e3a8a;
}

.im-download-note ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.im-download-note li {
    font-size: 13px;
    color: #334155;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* License Management Notice */
.im-license-management-note {
    margin-top: 20px;
    text-align: left;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.im-license-management-note h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: #1e3a8a;
    font-weight: 600;
}

.im-license-management-note p {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    margin: 0;
}

.im-license-management-note a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.im-license-management-note a:hover {
    color: #1e3a8a;
}

/* Footer (if needed later) */
.im-download-footer {
    text-align: center;
    font-size: 13px;
    color: #475569;
}

.im-info-text a {
    color: #1d4ed8;
    text-decoration: underline;
}

.im-info-text a:hover {
    color: #1e3a8a;
}

/* Responsive */
@media (max-width: 600px) {
    .im-download-section {
        padding: 16px;
    }

    .im-download-title {
        font-size: 18px;
    }

    .im-download-note,
    .im-license-management-note {
        padding: 12px 14px;
    }
}
