/* --- Global Dashboard Styles --- */
.tbl-dashboard-wrapper, .tbl-single-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Added specific margin for Single EA Page (License Manager) */
.tbl-single-wrapper {
    margin-top: 150px;
}

/* Hide Default Theme Title for Single EA Pages (Best Effort) */
body.single-tbl_ea .entry-title, 
body.single-tbl_ea .page-title, 
body.single-tbl_ea .post-title,
body.single-tbl_ea .main-title {
    display: none !important;
}

.tbl-section-active, .tbl-section-explore { margin-bottom: 40px; }

/* Dashboard Headers: border optimized for dark mode capability */
.tbl-dashboard-wrapper h2 { 
    font-size: 1.5rem; 
    border-bottom: 1px solid rgba(255,255,255,0.1); /* Subtle line for dark backgrounds */
    padding-bottom: 10px; 
    margin-bottom: 20px; 
}

/* --- Search & Controls --- */
.tbl-controls-container {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
    background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #f0f0f1; flex-wrap: wrap; gap: 15px;
}

/* Reduced Search Width */
.tbl-search-wrapper { 
    position: relative; 
    flex: 1; 
    max-width: 250px; 
    min-width: 200px; 
}
.tbl-search-icon { 
    position: absolute; 
    left: 10px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #444; 
    pointer-events: none; 
}
#tbl-search-input { width: 100%; padding: 8px 30px 8px 35px; font-size: 14px; border: 1px solid #ddd; border-radius: 4px; transition: all 0.2s; height: 36px; }
#tbl-search-input:focus { border-color: #2271b1; outline: none; box-shadow: 0 0 0 1px #2271b1; }

#tbl-search-clear { 
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); 
    cursor: pointer; background-color: #ccc; color: #fff; 
    font-size: 12px; width: 20px; height: 20px; line-height: 20px; 
    text-align: center; border-radius: 50%; z-index: 10; transition: background-color 0.2s ease;
}
#tbl-search-clear:hover { background-color: #dc3232; color: #fff; }

#tbl-no-results { color: inherit !important; opacity: 0.8; }

/* Reduced Sort Width */
.tbl-sort-wrapper select { 
    padding: 6px 12px; font-size: 14px; border: 1px solid #ddd; border-radius: 4px; 
    height: 36px; background-color: #f9f9f9; cursor: pointer; min-width: 130px; 
}

/* --- TAB STYLES (Adjusted for Dark Theme Site) --- */
.tbl-tabs-nav {
    display: flex;
    justify-content: center; /* Centered Tabs */
    gap: 40px; /* Generous spacing */
    margin-bottom: 35px;
    /* Light border visible on dark backgrounds */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); 
    padding-bottom: 0;
}

.tbl-tab-btn {
    /* STRICT RESET of Theme Styles */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    text-transform: none !important;
    outline: none !important;
    
    /* Custom Professional Design */
    padding: 15px 10px;
    font-size: 1.1rem;
    font-weight: 500;
    
    /* COLOR FIX FOR DARK THEMES: Light Gray/White so it's visible on Black */
    color: #e5e7eb !important; /* Forced Light Color */
    
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: -1px; /* Sit exactly on the line */
    letter-spacing: 0.5px;
}

.tbl-tab-btn:hover {
    color: #2ecc71 !important; /* Bright Neon Green for visibility on Dark */
    background: transparent !important;
}

.tbl-tab-btn.active {
    color: #2ecc71 !important; /* Bright Neon Green */
    font-weight: 700;
}

/* Modern Animated Underline */
.tbl-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #2ecc71; /* Bright Green Underline */
    transform: scaleX(0); 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.tbl-tab-btn.active::after {
    transform: scaleX(1); 
}

/* --- Animations --- */
.tbl-tab-content {
    animation: fadeIn 0.4s ease;
}

.tbl-empty-tab {
    text-align: center; padding: 50px 20px; background: #fcfcfc; border: 1px solid #eee; border-radius: 8px; color: #777;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- Grid & Cards (Modern Polish) --- */
.tbl-ea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; }

.tbl-ea-card { 
    background: #fff; 
    border: 1px solid #f0f0f1; 
    border-radius: 12px; 
    padding: 20px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); 
    display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; position: relative; 
}

.tbl-ea-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
}

.tbl-ea-logo { width: 100%; height: 110px; object-fit: contain; margin-bottom: 15px; background: #f9f9f9; border-radius: 8px; padding: 10px; }
.tbl-ea-card h3 { margin: 0 0 10px 0; font-size: 1.1rem; color: #000000; font-weight: 700; }
.tbl-ea-card h3 a { color: #000000; text-decoration: none; }

.tbl-card-header-status { position: absolute; top: 15px; right: 15px; z-index: 10; }
.tbl-status-badge { font-size: 0.7rem; padding: 4px 8px; border-radius: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tbl-status-badge.active { background-color: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }
.tbl-status-badge.inactive { background-color: #f3f4f6; color: #6b7280; }

/* EXCERPT: 3 Lines Visual Clamp */
.tbl-card-excerpt { 
    font-size: 0.9em; 
    color: #666; 
    line-height: 1.5; 
    margin-bottom: 20px; 
    flex-grow: 1; 
    
    /* CSS Line Clamping */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbl-card-actions { margin-top: auto; }
.tbl-view-btn { display: block; text-align: center; background-color: #2271b1 !important; color: #fff !important; text-decoration: none; padding: 10px 16px; border-radius: 6px; width: 100%; box-sizing: border-box; font-weight: 600; transition: background 0.2s; }
.tbl-view-btn:hover { background-color: #135e96 !important; }

/* --- Single Page Styles --- */
.tbl-back-nav { margin-bottom: 20px; }
.tbl-back-link { font-size: 0.95rem; color: #e5e7eb !important; /* Forced Light for dark theme */ text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.tbl-back-link:hover { color: #2ecc71 !important; text-decoration: underline; }

.tbl-single-header { display: flex; align-items: center; gap: 30px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.tbl-single-logo-wrapper { flex-shrink: 0; }
.tbl-single-logo { width: 120px; height: 120px; object-fit: contain; background: #fff; border: 1px solid #eee; padding: 10px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.tbl-logo-placeholder { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; background: #f0f0f1; border-radius: 12px; }
.tbl-logo-placeholder .dashicons { font-size: 40px; color: #ccc; width: 40px; height: 40px; }
.tbl-single-title-wrapper h1 { margin: 0 0 10px 0; font-size: 2.2rem; line-height: 1.2; }

.tbl-license-panel { background: #fcfcfc; border: 1px solid #e1e1e1; border-radius: 12px; padding: 30px; margin-bottom: 40px; max-width: 100%; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.tbl-panel-actions { margin-bottom: 25px; }
.tbl-download-btn { display: inline-block; background-color: #2271b1 !important; color: #fff !important; border: none !important; padding: 12px 24px; font-size: 1rem; border-radius: 6px; text-decoration: none; font-weight: 600; }
.tbl-download-btn:hover { background-color: #135e96 !important; }

.tbl-licenses-list h4 { font-size: 0.85rem; text-transform: uppercase; color: #646970; margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 8px; }
.tbl-licenses-list ul { list-style: none; padding: 0; margin: 0; }
.tbl-licenses-list li { background: #fff; border: 1px solid #ddd; padding: 12px 15px; margin-bottom: 10px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; font-family: monospace; font-size: 1.1em; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.tbl-delete-btn { background: #d63638; color: white; border: none; border-radius: 4px; width: 24px; height: 24px; line-height: 24px; text-align: center; cursor: pointer; font-size: 16px; padding: 0; display: flex; align-items: center; justify-content: center; }
.tbl-delete-btn:hover { background: #b32d2e; }

.tbl-add-form { display: flex; gap: 10px; margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; }
.tbl-add-form input { flex: 1; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1rem; background-color: #ffffff; color: #333333; }
.tbl-add-btn { background: #2271b1; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 1rem; font-weight: 500; }
.tbl-add-btn:hover { background-color: #135e96; }

.tbl-limit-reached { color: #d63638; font-weight: 600; text-align: center; margin-top: 15px; padding: 10px; background: #fcebeb; border-radius: 6px; }
.tbl-upsell { background-color: #f0f6fc; border: 1px solid #cce5ff; border-radius: 6px; padding: 20px; text-align: center; margin-top: 10px; }

.tbl-ea-description-section { margin-top: 40px; border-top: 1px solid #eee; padding-top: 20px; }
.tbl-ea-description-section h3 { font-size: 1.5rem; margin-bottom: 20px; }

@media (max-width: 600px) {
    .tbl-single-header { flex-direction: column; text-align: center; gap: 15px; }
    .tbl-single-title-wrapper h1 { font-size: 1.8rem; }
    .tbl-controls-container { flex-direction: column; align-items: stretch; }
    .tbl-search-wrapper { max-width: 100%; }
}