/* ==========================================================================
   PM Article Rewriter — Premium Admin UI
   Design system coerente con pm-model-importer.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   1. LAYOUT WRAPPER
   ========================================================================== */
.pmar-admin-wrapper {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding-right: 20px;
    margin-top: 20px;
    max-width: 1100px;
}

/* ==========================================================================
   2. HEADER
   ========================================================================== */
.pmar-admin-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 32px 36px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    border-left: 6px solid #ff3b68;
}

.pmar-admin-header h1 {
    color: #ffffff !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    margin: 0 0 6px 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 !important;
}

.pmar-admin-header h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #ff3b68;
}

.pmar-admin-header p.description {
    color: #94a3b8 !important;
    font-size: 14px !important;
    margin: 0 !important;
    line-height: 1.5;
}

/* ==========================================================================
   3. TABS
   ========================================================================== */
.pmar-nav-tab-wrapper {
    border-bottom: none;
    margin-bottom: 30px;
    display: flex;
    gap: 8px;
    padding: 5px;
    background: #e2e8f0;
    border-radius: 12px;
    width: fit-content;
}

.pmar-nav-tab {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #475569;
    border: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    cursor: pointer;
}

.pmar-nav-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pmar-nav-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.5);
}

.pmar-nav-tab.pmar-tab-active {
    color: #ff3b68;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    font-weight: 700;
}

/* ==========================================================================
   4. CARDS
   ========================================================================== */
.pmar-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
    overflow: hidden;
}

.pmar-card-header {
    background-color: #fafbfc;
    padding: 18px 28px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pmar-card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pmar-card-header h2 .dashicons {
    color: #ff3b68;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pmar-card-body {
    padding: 28px;
}

/* ==========================================================================
   5. NOTICES
   ========================================================================== */
.pmar-notice {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.pmar-notice .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.pmar-notice-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.pmar-notice-warning .dashicons {
    color: #f59e0b;
}

.pmar-notice a {
    color: #ff3b68;
    font-weight: 700;
}

/* ==========================================================================
   6. INPUT TOGGLE
   ========================================================================== */
.pmar-input-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.pmar-toggle-option {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.pmar-toggle-option .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pmar-toggle-option:hover {
    color: #334155;
}

.pmar-toggle-option.pmar-toggle-active {
    background: #ffffff;
    color: #ff3b68;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-weight: 700;
}

/* SEO AI Rewriter suite additions */
.pmsair-suite .pmar-results {
    display: block;
}

.pmsair-h2-list {
    display: grid;
    gap: 12px;
}

.pmsair-h2-row {
    display: grid;
    grid-template-columns: 24px minmax(170px, 1fr) minmax(170px, 1fr) minmax(220px, 1.2fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.pmsair-drag-handle {
    color: #94a3b8;
    cursor: grab;
}

.pmsair-h2-row.pmsair-dragging {
    opacity: 0.55;
    border-color: #ff3b68;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.pmsair-h2-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pmsair-h2-note {
    min-height: 42px;
    resize: vertical;
}

.pmsair-row-head,
.pmar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pmsair-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 22px;
    color: #334155;
    font-weight: 600;
}

.pmsair-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.pmsair-three-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.pmsair-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 14px 0;
    padding: 14px;
    background: #f8fafc;
    border-radius: 10px;
}

.pmsair-meta p {
    margin: 0;
}

.pmsair-result textarea {
    width: 100%;
    font-family: Consolas, Monaco, monospace;
    margin: 12px 0 18px;
}

.pmsair-ok,
.pmsair-detected {
    color: #008a20;
    font-weight: 700;
}

.pmsair-missing {
    color: #b32d2e;
    font-weight: 700;
}

.pmsair-warnings {
    background: #fff8e5;
    border-left: 4px solid #dba617;
    margin: 0 0 12px;
    padding: 10px 12px 10px 28px;
}

.pmsair-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0;
}

.pmsair-table-wrap table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    margin: 0;
}

.pmsair-table-wrap th,
.pmsair-table-wrap td,
.pmsair-preview table th,
.pmsair-preview table td {
    border: 1px solid #e2e8f0;
    padding: 9px 11px;
    text-align: left;
}

.pmsair-faq-section {
    margin-top: 18px;
}

.pmsair-faq-item {
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .pmsair-h2-row,
    .pmsair-two-cols,
    .pmsair-three-cols,
    .pmsair-meta {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   7. FORM ELEMENTS
   ========================================================================== */
.pmar-form-group {
    margin-bottom: 22px;
}

.pmar-form-group label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    font-size: 14px;
}

.pmar-form-control {
    width: 100%;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 11px 16px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    box-sizing: border-box;
    font-family: inherit;
}

.pmar-form-control:focus {
    background-color: #ffffff !important;
    border-color: #ff3b68 !important;
    box-shadow: 0 0 0 4px rgba(255, 59, 104, 0.1) !important;
    outline: none !important;
}

.pmar-textarea {
    resize: vertical;
    min-height: 180px;
    line-height: 1.7;
}

.pmar-select {
    max-width: 280px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 40px !important;
}

.pmar-small-input {
    max-width: 160px !important;
}

.pmar-field-hint {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 6px;
    margin-bottom: 0;
}

/* Settings form table */
.pmar-card .form-table th {
    width: 200px;
    padding: 18px 10px 18px 0;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
    vertical-align: top;
}

.pmar-card .form-table td {
    padding: 18px 0;
    vertical-align: top;
}

.pmar-card .form-table p.description {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 6px;
}

/* API Key wrapper */
.pmar-api-key-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 500px;
}

.pmar-api-key-wrapper .pmar-form-control {
    flex: 1;
}

.pmar-btn-toggle-key {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    flex-shrink: 0;
}

.pmar-btn-toggle-key:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Submit button override */
.pmar-admin-wrapper input[type="submit"].button-primary,
.pmar-admin-wrapper button.button-primary {
    background: linear-gradient(135deg, #ff3b68 0%, #ff5c82 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    border-radius: 10px !important;
    padding: 12px 28px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(255, 59, 104, 0.2) !important;
    height: auto !important;
    line-height: 1.4 !important;
    text-shadow: none !important;
    font-size: 14px !important;
}

.pmar-admin-wrapper input[type="submit"].button-primary:hover,
.pmar-admin-wrapper button.button-primary:hover {
    background: linear-gradient(135deg, #ff2354 0%, #ff4b73 100%) !important;
    box-shadow: 0 6px 20px rgba(255, 59, 104, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* ==========================================================================
   8. GENERATE BUTTON
   ========================================================================== */
.pmar-btn-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff3b68 0%, #ff5c82 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(255, 59, 104, 0.25);
    margin-top: 8px;
}

.pmar-btn-generate:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff2354 0%, #ff4b73 100%);
    box-shadow: 0 8px 28px rgba(255, 59, 104, 0.35);
    transform: translateY(-2px);
}

.pmar-btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pmar-btn-generate:active:not(:disabled) {
    transform: translateY(0);
}

/* Spinner */
.pmar-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: pmar-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes pmar-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   9. PROGRESS PANEL
   ========================================================================== */
.pmar-progress-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 30px;
    color: #94a3b8;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.pmar-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 16px;
    font-size: 14px;
}

.pmar-progress-header .dashicons {
    color: #38bdf8;
    animation: pmar-pulse 2s ease-in-out infinite;
}

@keyframes pmar-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pmar-progress-bar-container {
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.pmar-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff3b68, #ff8fab, #ff3b68);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    animation: pmar-bar-shimmer 2s linear infinite;
}

@keyframes pmar-bar-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pmar-progress-status {
    font-size: 13px;
    color: #64748b;
}

/* ==========================================================================
   10. RESULTS AREA
   ========================================================================== */
.pmar-results {
    margin-top: 10px;
}

/* Token Bar */
.pmar-token-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.pmar-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.pmar-token-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.pmar-token-badge strong {
    color: #0f172a;
    font-weight: 700;
}

.pmar-token-total {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.pmar-token-total strong {
    color: #ff3b68;
}

/* Result Sections */
.pmar-result-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.pmar-section-header {
    padding: 16px 24px;
    background: #fafbfc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pmar-section-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pmar-section-header h3 .dashicons {
    color: #ff3b68;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Collapsible */
.pmar-collapsible .pmar-section-header {
    cursor: pointer;
    transition: background 0.2s ease;
}

.pmar-collapsible .pmar-section-header:hover {
    background: #f1f5f9;
}

.pmar-toggle-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.pmar-collapsible.collapsed .pmar-toggle-icon {
    transform: rotate(-90deg);
}

.pmar-collapsible.collapsed .pmar-section-body {
    display: none;
}

/* Section Body */
.pmar-section-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
}

/* Title Section */
.pmar-title-section {
    border-left: 4px solid #ff3b68;
}

.pmar-generated-title {
    padding: 20px 28px;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

/* Article Preview */
.pmar-article-preview,
.pmar-faq-preview {
    padding: 32px;
    font-size: 15px;
    line-height: 1.8;
    color: #1e293b;
}

.pmar-article-preview h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 36px 0 16px;
    padding-left: 16px;
    border-left: 4px solid #ff3b68;
}

.pmar-article-preview h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 28px 0 12px;
}

.pmar-article-preview p {
    margin-bottom: 18px;
}

.pmar-article-preview strong {
    color: #0f172a;
}

.pmar-article-preview ul,
.pmar-article-preview ol {
    padding-left: 24px;
    margin-bottom: 18px;
}

.pmar-article-preview li {
    margin-bottom: 8px;
}

.pmar-article-preview blockquote {
    border-left: 4px solid #e2e8f0;
    padding: 12px 20px;
    margin: 20px 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-style: italic;
}

.pmar-faq-preview h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 20px;
}

.pmar-faq-preview h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 24px 0 8px;
}

.pmar-faq-preview p {
    margin-bottom: 12px;
    color: #475569;
}

/* Keywords List */
.pmar-keywords-list {
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pmar-keyword-pill {
    display: inline-block;
    padding: 5px 14px;
    background: #fef2f2;
    color: #be123c;
    border: 1px solid #fecaca;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   11. ACTION BUTTONS BAR
   ========================================================================== */
.pmar-actions-bar {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pmar-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pmar-btn-action .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pmar-btn-copy {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.pmar-btn-copy:hover {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    transform: translateY(-1px);
}

.pmar-btn-draft {
    background: linear-gradient(135deg, #ff3b68, #ff5c82);
    color: #ffffff;
}

.pmar-btn-draft:hover {
    box-shadow: 0 4px 14px rgba(255, 59, 104, 0.3);
    transform: translateY(-1px);
}

.pmar-btn-regen {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.pmar-btn-regen:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Draft Success */
.pmar-draft-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
}

.pmar-draft-success .dashicons {
    color: #16a34a;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.pmar-draft-success a {
    color: #ff3b68;
    font-weight: 700;
}

.pmar-draft-success-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pmar-draft-success-links a {
    color: #ff3b68;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pmar-draft-success-links a:hover {
    color: #ff2354;
    text-decoration: underline;
}

.pmar-draft-success-links .pmar-separator {
    color: #cbd5e1;
    font-weight: normal;
    user-select: none;
}

/* ==========================================================================
   11b. SCHEDULE AND CODA STYLES
   ========================================================================== */
.pmar-schedule-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.pmar-col-6 {
    flex: 2 1 400px;
}

.pmar-col-3 {
    flex: 1 1 180px;
}

.pmar-schedule-layout {
    display: flex;
    gap: 24px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.pmar-schedule-main {
    flex: 1;
    margin-bottom: 0 !important;
}

.pmar-schedule-sidebar {
    width: 300px;
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

.pmar-no-padding {
    padding: 0 !important;
}

.pmar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 13px;
    text-align: left;
}

.pmar-table th {
    background-color: #fafbfc;
    padding: 14px 20px;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.pmar-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.pmar-table tr:last-child td {
    border-bottom: none;
}

.pmar-table tr:hover td {
    background-color: #fafbfc;
}

.pmar-table-url {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pmar-table-url a {
    color: #0f172a;
    text-decoration: none;
    font-weight: 500;
}

.pmar-table-url a:hover {
    color: #ff3b68;
}

.pmar-empty-row td {
    text-align: center;
    padding: 36px !important;
    color: #94a3b8;
    font-style: italic;
    background-color: #ffffff !important;
}

/* Status Badges */
.pmar-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pmar-badge-pending {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.pmar-badge-processing {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.pmar-badge-completed {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.pmar-badge-failed {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    cursor: help;
}

/* Inline Spinner */
.pmar-spinner-inline {
    width: 12px;
    height: 12px;
    border-width: 2px;
    border-top-color: #c2410c;
    margin-right: 2px;
}

/* Buttons and Links */
.pmar-btn-delete {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pmar-btn-delete:hover {
    color: #ef4444;
    background-color: #fef2f2;
}

.pmar-btn-delete .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pmar-btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pmar-btn-clear {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px !important;
    height: auto !important;
    border-radius: 6px !important;
}

.pmar-btn-clear:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.pmar-btn-clear .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.pmar-cron-info {
    margin-bottom: 20px;
    background-color: #f8fafc;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.pmar-cron-info p {
    margin: 0 0 8px;
    font-size: 13px;
    color: #475569;
}

.pmar-cron-info p:last-child {
    margin-bottom: 0;
}

.pmar-code-date {
    background-color: #cbd5e1;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.pmar-history-links {
    margin-left: 8px;
    font-size: 12px;
}

.pmar-history-links a {
    color: #ff3b68;
    text-decoration: none;
    font-weight: 600;
}

.pmar-history-links a:hover {
    text-decoration: underline;
}

.pmar-error-desc {
    font-size: 12px;
    color: #ef4444;
    margin-left: 8px;
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.pmsair-writer-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
    gap: 24px;
    align-items: start;
}

.pmsair-writer-ai-panel {
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    padding: 18px;
}

.pmsair-writer-ai-panel .pmar-form-group:last-child,
.pmsair-writer-main-fields .pmar-form-group:last-child {
    margin-bottom: 0;
}

.pmsair-link-picker-list {
    display: grid;
    gap: 14px;
}

.pmsair-link-picker {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fbfdff;
}

.pmsair-link-input-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.pmsair-link-results {
    position: static;
    z-index: 1;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.pmsair-link-result {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f0f1;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.pmsair-link-result:last-child {
    border-bottom: 0;
}

.pmsair-link-result:hover {
    background: #f6f7f7;
}

.pmsair-link-result span,
.pmsair-link-selected span {
    justify-self: end;
    color: #ff3b68;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.pmsair-link-result small,
.pmsair-link-selected small {
    grid-column: 1 / -1;
    color: #646970;
}

.pmsair-link-result-empty {
    padding: 10px 12px;
    color: #646970;
}

.pmsair-link-selected {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 3px 10px;
    align-items: center;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #f6f7f7;
}

@media (max-width: 960px) {
    .pmsair-writer-top-grid {
        grid-template-columns: 1fr;
    }

    .pmsair-link-input-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   12. RESPONSIVE */
   ========================================================================== */
@media (max-width: 782px) {
    .pmar-admin-wrapper {
        padding-right: 10px;
    }

    .pmar-admin-header {
        padding: 20px 24px;
    }

    .pmar-admin-header h1 {
        font-size: 20px !important;
    }

    .pmar-nav-tab-wrapper {
        width: 100%;
    }

    .pmar-nav-tab {
        flex: 1;
        justify-content: center;
        text-align: center;
        padding: 10px 12px;
        font-size: 12px;
    }

    .pmar-card-body {
        padding: 18px;
    }

    .pmar-generated-title {
        font-size: 20px;
    }

    .pmar-article-preview,
    .pmar-faq-preview {
        padding: 20px;
    }

    .pmar-actions-bar {
        flex-direction: column;
    }

    .pmar-btn-action {
        justify-content: center;
    }

    .pmar-token-bar {
        flex-direction: column;
    }

    .pmar-card .form-table th {
        display: block;
        width: 100%;
        padding-bottom: 4px;
    }

    .pmar-card .form-table td {
        display: block;
        padding-top: 0;
    }

    .pmar-api-key-wrapper {
        max-width: 100%;
    }
}
