/**
 * RankBotAI — Combined view styles.
 * Generated from inline <style> blocks for WP coding standards compliance.
 *
 * Sections:
 *   1. Bulk Page Filters
 *   2. History Page
 *   3. Settings Page
 *   4. Sidebar Metabox
 *   5. Post Editor Toolbar
 *   6. Confirmation Modal
 */

/* ============================================================
   1. Bulk Page Filters
   ============================================================ */
.rb-filters-card .rb-card-body { padding: 0 !important; }

.rb-filter-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; background: #fff; border-bottom: 1px solid #f1f5f9; gap: 20px;
    flex-wrap: wrap;
}
.rb-search-wrap { display: flex; align-items: center; position: relative; width: 320px; max-width: 100%; }
.rb-search-wrap input { 
    width: 100%; padding: 8px 12px 8px 36px; border: 1px solid #e2e8f0; border-radius: 8px; 
    background: #f8fafc; color: #334155; font-size: 14px; transition: all 0.2s; height: 38px;
}
.rb-search-wrap input:focus { background: #fff; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.1); outline: none; }
.rb-search-icon { position: absolute; left: 12px; color: #94a3b8; font-size: 16px; top: 50%; transform: translateY(-50%); }

.rb-status-tabs-group { display: flex; background: #f1f5f9; padding: 4px; border-radius: 8px; gap: 2px; }
.rb-status-radio { display: none; }
.rb-status-label { 
    padding: 6px 14px; font-size: 13px; font-weight: 500; color: #64748b; cursor: pointer; border-radius: 6px; transition: all 0.2s; line-height: 1.4; white-space: nowrap; user-select: none;
}
.rb-status-radio:checked + .rb-status-label { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(0,0,0,0.05); font-weight: 600; }
.rb-status-label:hover { color: #334155; }

.rb-advanced-filters { padding: 15px 20px; background: #fcfcfc; display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.rb-filter-col { display: flex; flex-direction: column; gap: 8px; }
.rb-filter-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; color: #94a3b8; margin-bottom: 2px; }

.rb-pill-check { display: inline-flex; position: relative; margin-right: 6px; margin-bottom: 2px; }
.rb-pill-check input { opacity: 0; position: absolute; width: 0; height: 0; }
.rb-pill-check span {
    display: inline-block; padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff;
    font-size: 12px; color: #475569; cursor: pointer; transition: all 0.2s; user-select: none;
}
.rb-pill-check input:checked + span { border-color: #3b82f6; background: #eff6ff; color: #2563eb; font-weight: 500; }

.rb-actions-row { margin-left: auto; display: flex; align-items: center; gap: 12px; margin-top: auto; }

.rb-row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

.rb-icon-btn-secondary {
    width: 32px; height: 32px; border-radius: 6px; background: #fff; border: 1px solid #cbd5e1;
    color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.rb-icon-btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; color: #334155; transform: translateY(-1px); }
.rb-icon-btn-secondary .dashicons { font-size: 16px; width: 16px; height: 16px; }

.rb-btn-auto-lg {
    height: 32px; padding: 0 12px; border-radius: 6px; border: none; cursor: pointer;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff;
    display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); transition: all 0.2s;
}
.rb-btn-auto-lg:hover { 
    transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3); 
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.rb-btn-auto-lg .dashicons { font-size: 16px; width: 16px; height: 16px; display: inline-block; margin-top: 1px; }

/* ============================================================
   2. History Page
   ============================================================ */
.rankbot-history-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    table-layout: fixed;
}
.rankbot-history-table thead th {
    background: #f9fafb;
    color: #4b5563;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
.rankbot-history-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rankbot-history-table tbody tr:last-child td {
    border-bottom: none;
}
.rankbot-history-table tbody tr:hover {
    background-color: #f9fafb;
}
.rb-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid transparent;
    text-transform: uppercase;
}
.rb-badge-success { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.rb-badge-error { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.rb-badge-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.rb-badge-neutral { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }

.pagination-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 5px;
}
.pagination-links .page-numbers {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
}
.pagination-links .page-numbers.current {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* ============================================================
   3. Settings Page
   ============================================================ */
.rankbot-settings-wrap { max-width: 98%; margin-top: 10px; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; margin-right: 20px; }

.rankbot-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid #e5e7eb; padding-bottom: 15px; margin-top: 10px; }
.rankbot-subtitle { color: #6b7280; font-size: 14px; }

.rankbot-balance-badge { background: #eff6ff; color: #1d4ed8; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; border: 1px solid #dbeafe; }
.rankbot-topup-btn { background: #2563eb; color: #fff; text-decoration: none; padding: 4px 10px; border-radius: 99px; font-size: 11px; margin-left: 8px; transition: background 0.2s; }
.rankbot-topup-btn:hover { background: #1d4ed8; color: #fff; }

.rankbot-grid { display: grid; grid-template-columns: 3fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 1200px) { .rankbot-grid { grid-template-columns: 2fr 1fr; } }
@media (max-width: 1000px) { .rankbot-grid { grid-template-columns: 1fr; } }

.rankbot-main-col { display: flex; flex-direction: column; gap: 24px; }

.rankbot-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 0px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: transform 0.2s, box-shadow 0.2s; }
.rankbot-card:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.05); transform: translateY(-1px); }

.rankbot-card-header { padding: 18px 24px; border-bottom: 1px solid #f1f5f9; background: #fff; display: flex; align-items: center; justify-content: space-between; }
.rankbot-card-title { margin: 0; font-size: 16px; font-weight: 600; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.rankbot-card-title .dashicons { color: #64748b; font-size: 20px; width: 20px; height: 20px; }
.rankbot-card-body { padding: 24px; }

.form-group { margin-bottom: 24px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; color: #334155; font-size: 14px; }
.form-description { color: #64748b; font-size: 13px; margin-top: 6px; line-height: 1.5; }

.rankbot-select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #fff; transition: border-color 0.2s; }
.rankbot-select:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1); }

.rankbot-toggle-row { display: flex; align-items: flex-start; gap: 16px; padding: 16px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.rankbot-toggle-input { margin-top: 4px !important; transform: scale(1.2); }

.rankbot-save-bar { background: #fff; border: 1px solid #e5e7eb; padding: 16px 24px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

.promo-card { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff; border: none; margin-bottom: 24px; }
.promo-card .rankbot-card-header { background: rgba(255,255,255,0.05); border-bottom-color: rgba(255,255,255,0.1); }
.promo-card .rankbot-card-title { color: #fff; }
.promo-card .dashicons { color: #38bdf8; }
.promo-list { list-style: none; padding: 0; margin: 0; }
.promo-list li { margin-bottom: 12px; display: flex; gap: 8px; font-size: 14px; color: #cbd5e1; }
.promo-list li .dashicons { color: #38bdf8; }
.promo-btn { display: block; width: 100%; box-sizing: border-box; text-align: center; background: #38bdf8; color: #0f172a; font-weight: 700; padding: 12px; border-radius: 8px; text-decoration: none; margin-top: 20px; transition: opacity 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.promo-btn:hover { opacity: 0.9; color: #0f172a; transform: translateY(-1px); }

.other-product-item { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; padding: 12px; border-radius: 8px; transition: background 0.2s; }
.other-product-item:hover { background: #f8fafc; }
.other-product-icon { flex-shrink: 0; width: 40px; height: 40px; background: #eff6ff; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #2563eb; }
.other-product-info h4 { margin: 0 0 4px 0; font-size: 14px; color: #0f172a; font-weight: 600; }
.other-product-info p { margin: 0; font-size: 13px; color: #64748b; }
.other-product-link { font-size: 12px; color: #2563eb; font-weight: 600; text-decoration: none; display: inline-block; margin-top: 4px; }

/* ============================================================
   4. Sidebar Metabox
   ============================================================ */
.rankbot-sidebar-panel { margin-top: 5px; }
.rankbot-sidebar-btn {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; box-sizing: border-box;
    padding: 9px 12px; margin-bottom: 8px;
    background: #fff; border: 1px solid #dcdcde; border-radius: 4px;
    color: #2271b1; font-weight: 500; cursor: pointer;
    transition: all 0.2s; font-size: 13px; text-decoration: none;
}
.rankbot-sidebar-btn:hover { background: #f0f7ff; border-color: #2271b1; color: #2271b1; }
.rankbot-sidebar-btn .dashicons { font-size: 16px; width: 16px; height: 16px; margin-right: 6px; }

.rankbot-btn-primary { 
    background: #f6f7f7; border-color: #2271b1; color: #2271b1; font-weight: 600;
}
.rankbot-btn-cost {
    background: #f0f0f1; color: #646970; border-radius: 10px; padding: 2px 6px; font-size: 10px; font-weight: 600;
}

.rankbot-stat-item { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }
.rankbot-stat-label { color: #646970; }
.rankbot-stat-value { font-weight: 600; color: #1d2327; }

.rankbot-score-ring {
    --rb-score: 0;
    --rb-score-color: #646970;
    width: 78px; height: 78px; border-radius: 50%;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px auto;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 6px 16px rgba(15, 23, 42, 0.08);
    background:
        conic-gradient(var(--rb-score-color) calc(var(--rb-score) * 1%), #dcdcde 0);
}
.rankbot-score-ring::before {
    content: '';
    position: absolute;
    inset: 7px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px #dcdcde;
}
.rankbot-score-ring .rb-score-text {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.rankbot-score-ring .rb-score-num {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.3px;
    color: var(--rb-score-color);
}
.rankbot-score-ring .rb-score-sub {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
    color: #646970;
}
.rankbot-score-bad { --rb-score-color: #d63638; }
.rankbot-score-ok { --rb-score-color: #dba617; }
.rankbot-score-good { --rb-score-color: #008a20; }

.rankbot-recent-title {
    margin: 10px 0 8px 0;
    font-size: 12px;
    font-weight: 700;
    color: #1d2327;
}
.rankbot-recent-item { display:flex; justify-content:space-between; gap:10px; margin-bottom:6px; font-size: 12px; }
.rankbot-recent-action { color:#1d2327; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rankbot-recent-date { color:#646970; white-space:nowrap; }
.rankbot-restore-btn { display:inline-flex; align-items:center; gap:6px; text-decoration:none; font-size:12px; font-weight:600; color:#b91c1c; }
.rankbot-restore-btn .dashicons { font-size:16px; width:16px; height:16px; }

#rankbot-sidebar-log { 
    display:none; margin-top: 10px; padding: 10px; background: #fff8e5; 
    border-left: 3px solid #f6e05e; font-size: 12px; color: #b45309; line-height: 1.4;
    margin-bottom: 10px; border-radius: 2px;
}
.rankbot-sidebar-divider { margin: 15px 0; border-top: 1px solid #f0f0f1; }

/* ============================================================
   5. Post Editor Toolbar
   ============================================================ */
@keyframes rankbotGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.rankbot-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rankbot-toolbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-size: 200% 200%;
    animation: rankbotGradient 15s ease infinite;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}
.rankbot-toolbar::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: rankbotShine 8s infinite;
    pointer-events: none;
}
@keyframes rankbotShine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.rankbot-toolbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}
.rankbot-toolbar-title {
    font-weight: 800;
    font-size: 16px;
    color: #e2e8f0;
    letter-spacing: -0.5px;
}
.rankbot-toolbar-brand .dashicons {
     color: #60a5fa !important;
}

.rankbot-actions {
    display: flex;
    gap: 12px;
    flex: 1;
    position: relative;
    z-index: 2;
    flex-wrap: wrap; 
}

.rankbot-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}
.rankbot-action-btn:hover:not(.rankbot-disabled) {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}
.rankbot-action-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transition: color 0.2s;
}
.rankbot-action-btn:hover .dashicons {
    color: #60a5fa;
}

.rankbot-action-btn.primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
    padding: 10px 22px;
}
.rankbot-action-btn.primary .dashicons { color: #fff; }
.rankbot-action-btn.primary:hover:not(.rankbot-disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.rankbot-action-btn.primary.rb-pulse {
    animation: rankbotPulse 3s infinite;
}
@keyframes rankbotPulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.rankbot-disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    background: rgba(255,255,255,0.02) !important;
    color: #64748b !important;
    box-shadow: none !important;
    transform: none !important;
}

.rankbot-badge-cost {
    display:flex; align-items:center; gap:3px; font-size: 11px; 
    color:#cbd5e1;
    background:rgba(255,255,255,0.1); 
    padding:3px 8px; border-radius: 99px; margin-left:auto; font-weight: 600;
}
.rankbot-action-btn.primary .rankbot-badge-cost {
    background: rgba(0,0,0,0.2); 
    color: #fff;
}

.rankbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 4px;
}
.rankbot-tooltip {
    position: absolute;
    background: #000;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    display: none;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}
.rankbot-tooltip::before {
    content:''; position:absolute; top:-4px; left:50%; margin-left:-4px;
    border-width: 0 4px 4px; border-style: solid; border-color: transparent transparent #000;
}
.rankbot-action-btn:hover .rankbot-tooltip {
    display: block;
}

.rankbot-sub-panel {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.rb-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rb-progress-track {
    height: 16px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin-bottom: 24px; border: 1px solid #e2e8f0;
}
.rb-progress-bar {
    height: 100%; width: 0%; transition: width 1s ease-in-out, background-color 0.5s;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}
.rb-progress-bar.good, .rb-progress-bar.rankbot-score-good { background: linear-gradient(90deg, #22c55e, #16a34a); }
.rb-progress-bar.ok, .rb-progress-bar.rankbot-score-ok { background: linear-gradient(90deg, #f59e0b, #d97706); }
.rb-progress-bar.bad, .rb-progress-bar.rankbot-score-bad { background: linear-gradient(90deg, #ef4444, #dc2626); }

.rb-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.rb-details-btn:hover { background: rgba(99, 102, 241, 0.15); transform: translateY(-1px); }
.rb-details-btn:active { transform: translateY(1px); }

.rb-accordion-item {
    border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 10px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.rb-accordion-header {
    padding: 14px 18px; background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 600; color: #334155;
    transition: background 0.2s;
}
.rb-accordion-header:hover { background: #f8fafc; }
.rb-accordion-content {
    display: none; padding: 18px; background: #fff; border-top: 1px solid #e2e8f0; font-size: 14px; line-height: 1.6; color: #475569;
}
.rb-accordion-item.open .rb-accordion-content { display: block; }
.rb-status-icon { margin-right: 12px; font-size: 20px; }

/* ============================================================
   6. Confirmation Modal
   ============================================================ */
.rankbot-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(12px);
    z-index: 100000; display: flex; align-items: center; justify-content: center;
}
.rankbot-modal-card {
    background: #fff; width: 400px; max-width: 90%;
    border-radius: 24px; box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.3);
    position: relative; overflow: hidden; animation: rbModalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 32px; text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@keyframes rbModalIn { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.rankbot-modal-close {
    position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 24px; cursor: pointer; color: #cbd5e1; line-height: 1; z-index: 2;
}
.rankbot-modal-close:hover { color: #0f172a; }

.rankbot-modal-icon-wrap {
    width: 64px; height: 64px; background: #eff6ff; border-radius: 20px; color: #3b82f6;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.15);
}
.rankbot-modal-icon { font-size: 32px; width: 32px; height: 32px; }

.rankbot-modal-title { margin: 0 0 8px 0; font-size: 22px; font-weight: 700; color: #0f172a; letter-spacing: -0.5px; }
.rankbot-modal-desc { margin: 0 0 24px 0; font-size: 15px; color: #64748b; line-height: 1.5; }

.rankbot-modal-cost-row { 
    background: #f8fafc; border-radius: 12px; padding: 10px 14px; margin-bottom: 24px; 
    display: inline-flex; align-items: center; gap: 8px; border: 1px solid #e2e8f0;
}
.rankbot-cost-badge-large {
    display: flex; align-items: center; gap: 5px; background: #0f172a; color: #fff; 
    padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: 13px;
}

.rankbot-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rankbot-modal-actions-single { display: grid; grid-template-columns: 1fr; }
#rankbot-modal-step-process .rankbot-modal-actions { grid-template-columns: 1fr; }

.rankbot-btn-sec, .rankbot-btn-pri, .rankbot-btn-success {
    padding: 12px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; border: none;
}
.rankbot-btn-sec { background: #fff; border: 1px solid #cbd5e1; color: #475569; }
.rankbot-btn-sec:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }
.rankbot-btn-pri { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; 
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.rankbot-btn-pri:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }

.rankbot-btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: #fff;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}
.rankbot-btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3); }

.rb-sci-spinner-wrap { position: relative; width: 80px; height: 80px; margin: 0 auto 30px auto; perspective: 1000px; }
.rb-sci-spinner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: rbFloat 3s ease-in-out infinite; }

.rb-sci-core {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 20px; height: 20px; background: #3b82f6; border-radius: 50%;
    box-shadow: 0 0 20px #3b82f6, 0 0 40px #2563eb;
    animation: rbCorePulse 1.5s ease-in-out infinite alternate;
}

.rb-sci-ring {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; border: 2px solid transparent; border-top-color: #60a5fa; border-bottom-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.rb-sci-ring-1 { animation: rbSpin3D1 2s linear infinite; }
.rb-sci-ring-2 { width: 80%; height: 80%; top: 10%; left: 10%; border-top-color: #93c5fd; border-bottom-color: #93c5fd; animation: rbSpin3D2 3s linear infinite; }
.rb-sci-ring-3 { width: 120%; height: 120%; top: -10%; left: -10%; border-width: 1px; border-top-color: #2563eb; border-bottom-color: transparent; border-left-color: #2563eb; opacity: 0.5; animation: rbSpin3D3 5s linear infinite; }

@keyframes rbFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes rbCorePulse { 0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; } 100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } }
@keyframes rbSpin3D1 { 0% { transform: rotateX(70deg) rotateZ(0deg); } 100% { transform: rotateX(70deg) rotateZ(360deg); } }
@keyframes rbSpin3D2 { 0% { transform: rotateZ(0deg) rotateY(60deg); } 100% { transform: rotateZ(-360deg) rotateY(60deg); } }
@keyframes rbSpin3D3 { 0% { transform: rotateZ(0deg); } 100% { transform: rotateZ(360deg); } }

.rankbot-success-anim {
    width: 72px; height: 72px; background: #dcfce7; color: #16a34a; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto;
    animation: rbSuccessPop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}
.rankbot-checkmark { width: 36px; height: 36px; stroke-dasharray: 50; stroke-dashoffset: 50; animation: rbDrawCheck 0.6s 0.2s forwards; }
@keyframes rbSuccessPop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rbDrawCheck { to { stroke-dashoffset: 0; } }

/* ============================================================
   7. Dashboard v2 — Stats Grid & Activity Feed
   ============================================================ */
.rb-period-select {
    font-size: 13px;
    height: 34px;
    border: 1px solid var(--rb-border, #d1d5db);
    border-radius: var(--rb-radius-sm, 6px);
    padding: 0 28px 0 10px;
    background: var(--rb-bg-card, #fff);
    color: var(--rb-text-primary, #111827);
    cursor: pointer;
    transition: border-color var(--rb-transition, 0.2s);
}
.rb-period-select:focus {
    border-color: var(--rb-primary, #4f46e5);
    box-shadow: 0 0 0 2px var(--rb-primary-ring, rgba(99, 102, 241, 0.1));
    outline: none;
}

/* 5-column stats grid */
.rb-stats-grid-v2 {
    display: grid;
    grid-template-columns: 1.3fr repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 1200px) {
    .rb-stats-grid-v2 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .rb-stats-grid-v2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .rb-stats-grid-v2 { grid-template-columns: 1fr; }
}

.rb-stat-card {
    background: var(--rb-bg-card, #fff);
    border: 1px solid var(--rb-border, #e5e7eb);
    border-radius: var(--rb-radius-lg, 12px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform var(--rb-transition, 0.2s), box-shadow var(--rb-transition, 0.2s);
    position: relative;
    overflow: hidden;
}
.rb-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--rb-shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1));
}

/* Gradient balance card */
.rb-stat-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    grid-row: span 1;
}
.rb-stat-gradient .rb-stat-label { color: rgba(255,255,255,0.8); }
.rb-stat-card-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}
.rb-stat-plan-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.rb-stat-balance-block {
    margin-top: auto;
}
.rb-stat-big {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.rb-topup-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: var(--rb-radius, 8px);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s, transform 0.2s;
    margin-top: 8px;
}
.rb-topup-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* Regular stat cards */
.rb-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--rb-radius, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.rb-stat-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}
.rb-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--rb-text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rb-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--rb-text-primary, #111827);
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.rb-stat-sub {
    font-size: 11px;
    color: var(--rb-text-muted, #9ca3af);
}

/* Dashboard row (chart + activity, resources + connection) */
.rb-dashboard-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 960px) {
    .rb-dashboard-row { grid-template-columns: 1fr; }
}

/* Card headers */
.rb-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rb-border-light, #f3f4f6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rb-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--rb-text-primary, #111827);
    display: flex;
    align-items: center;
}
.rb-card-header h3 .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.rb-link-subtle {
    font-size: 12px;
    color: var(--rb-primary, #4f46e5);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.rb-link-subtle:hover { color: var(--rb-primary-hover, #4338ca); }

/* Chart card */
.rb-chart-card { min-height: 320px; }
.rb-chart-wrap {
    padding: 16px 20px;
    height: 260px;
    position: relative;
}

/* Activity feed */
.rb-activity-card { max-height: 400px; display: flex; flex-direction: column; }
.rb-activity-list {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
.rb-activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--rb-border-light, #f3f4f6);
    transition: background 0.15s;
    align-items: flex-start;
}
.rb-activity-item:hover { background: var(--rb-bg, #f9fafb); }
.rb-activity-item:last-child { border-bottom: none; }

.rb-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.rb-status-ok { background: var(--rb-success, #10b981); }
.rb-status-fail { background: var(--rb-danger, #ef4444); }
.rb-status-pending { background: var(--rb-warning, #f59e0b); }

.rb-activity-content { flex: 1; min-width: 0; }
.rb-activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rb-text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rb-activity-title a {
    color: var(--rb-primary, #4f46e5);
    text-decoration: none;
}
.rb-activity-title a:hover { text-decoration: underline; }

.rb-activity-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 3px;
    flex-wrap: wrap;
}
.rb-activity-action {
    font-size: 11px;
    color: var(--rb-text-secondary, #6b7280);
    font-weight: 500;
}
.rb-activity-cost {
    font-size: 11px;
    color: var(--rb-warning-text, #92400e);
    background: var(--rb-warning-bg, #fffbeb);
    padding: 1px 6px;
    border-radius: var(--rb-radius-full, 9999px);
    font-weight: 600;
}
.rb-activity-date {
    font-size: 11px;
    color: var(--rb-text-muted, #9ca3af);
}

.rb-activity-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--rb-text-muted, #9ca3af);
}
.rb-activity-empty p {
    margin: 0;
    font-size: 13px;
}

/* Resource type bar chart */
.rb-type-list { padding: 16px 20px; }
.rb-type-row { margin-bottom: 14px; }
.rb-type-row:last-child { margin-bottom: 0; }
.rb-type-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.rb-type-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--rb-text-primary, #111827);
    text-transform: capitalize;
}
.rb-type-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--rb-text-primary, #111827);
}
.rb-type-bar-track {
    height: 6px;
    background: var(--rb-border-light, #f3f4f6);
    border-radius: var(--rb-radius-full, 9999px);
    overflow: hidden;
}
.rb-type-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--rb-primary, #4f46e5), var(--rb-accent, #7c3aed));
    border-radius: var(--rb-radius-full, 9999px);
    transition: width 0.6s var(--rb-transition-spring, cubic-bezier(0.16, 1, 0.3, 1));
}

/* Connection card */
.rb-key-code {
    background: var(--rb-border-light, #f3f4f6);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--rb-text-secondary, #4b5563);
    font-size: 12px;
}
.rb-connection-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
