/* ===================================
   RBAC Dashboard Styles
   Follows Dream X theme from style.css
   =================================== */

/* === RBAC PAGE LAYOUT === */
.rbac-page,
.rbac-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem var(--spacing-md);
    min-height: calc(100vh - 60px);
}

/* === RBAC HEADER === */
.rbac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), #A53CFF);
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: 0 10px 40px rgba(255, 77, 255, 0.3);
}

.rbac-header h1 {
    color: white;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* === RBAC NAVIGATION === */
.rbac-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rbac-nav a {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.rbac-nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.rbac-nav a.active {
    background: white;
    color: var(--primary-color);
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #A53CFF);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 77, 255, 0.15);
    border-color: var(--primary-color);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-card .subtext {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* === DASHBOARD GRID === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* === PANELS === */
.panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.panel:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-dark);
    font-weight: 700;
}

.panel-header a {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.panel-header a:hover {
    color: var(--primary-hover);
}

/* === ROLE TREE === */
.role-tree {
    font-family: var(--font-primary);
}

.role-tree ul {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0;
}

.role-tree > ul {
    padding-left: 0;
}

.role-tree li {
    position: relative;
    padding: 0.35rem 0;
}

.role-tree li::before {
    content: '├── ';
    color: var(--text-lighter);
    font-family: monospace;
}

.role-tree li:last-child::before {
    content: '└── ';
}

.role-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.role-item:hover {
    background: rgba(255, 77, 255, 0.1);
}

.role-item.system {
    background: linear-gradient(135deg, rgba(63, 214, 255, 0.15), rgba(165, 60, 255, 0.15));
    color: var(--primary-color);
}

.role-item .priority {
    font-size: 0.7rem;
    color: var(--text-lighter);
}

/* === ALERTS === */
.alerts-list {
    max-height: 300px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.alert-item:hover {
    transform: translateX(3px);
}

.alert-item.critical {
    background: var(--error-light);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-item.warning {
    background: #fef3c7;
    color: #d97706;
    border-left: 4px solid #d97706;
}

.alert-item.info {
    background: #e0e7ff;
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.alert-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-content .message {
    font-weight: 600;
}

.alert-content .meta {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* === AUDIT LOG === */
.audit-log {
    max-height: 400px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.log-entry:hover {
    background: var(--bg-light);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-sm);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-lighter);
    font-size: 0.75rem;
    white-space: nowrap;
    width: 80px;
    flex-shrink: 0;
    font-family: monospace;
}

.log-action {
    flex: 1;
}

.log-action .action-type {
    font-weight: 600;
    color: var(--text-dark);
}

.log-action .details {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.125rem;
}

.log-actor {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
}

/* === CACHE STATS === */
.cache-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}

.cache-stat {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.2s ease;
}

.cache-stat:hover {
    background: rgba(255, 77, 255, 0.1);
}

.cache-stat .label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cache-stat .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

/* === QUICK ACTIONS === */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.quick-action:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.quick-action .icon {
    font-size: 1.25rem;
}

.quick-action .text {
    flex: 1;
}

.quick-action .text h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.quick-action .text p {
    margin: 0.125rem 0 0 0;
    font-size: 0.75rem;
    color: var(--text-light);
}

.quick-action .arrow {
    color: var(--primary-color);
    font-weight: 600;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 0.625rem;
}

.empty-state p {
    margin: 0;
    color: var(--text-light);
}

/* === PERMISSION GROUPS === */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.875rem;
}

.group-card {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.group-card:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.group-card h4 {
    margin: 0 0 0.375rem 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.group-card .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.group-card .label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* === BUTTONS === */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #A53CFF);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* === TABLES === */
.users-table,
.audit-table,
.overrides-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td,
.audit-table th,
.audit-table td,
.overrides-table th,
.overrides-table td,
.history-table th,
.history-table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.users-table th,
.audit-table th,
.overrides-table th,
.history-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-light);
}

.users-table tbody tr:hover,
.audit-table tbody tr:hover,
.overrides-table tbody tr:hover,
.history-table tbody tr:hover {
    background: rgba(255, 77, 255, 0.05);
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-grant,
.badge-success {
    background: var(--success-light);
    color: var(--success-color);
}

.badge-deny,
.badge-error {
    background: var(--error-light);
    color: var(--error-color);
}

.badge-warning,
.badge-temp {
    background: #fef3c7;
    color: #d97706;
}

.badge-info,
.badge-permanent {
    background: var(--bg-gray);
    color: var(--text-light);
}

.badge-module {
    background: #e8f4ff;
    color: #0066cc;
}

.badge-resource {
    background: #fef3c7;
    color: #d97706;
}

.badge-action {
    background: var(--success-light);
    color: var(--success-color);
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    margin: 0.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.role-badge.primary {
    background: linear-gradient(135deg, var(--primary-color), #A53CFF);
    color: white;
}

/* === FORMS === */
.search-bar {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 77, 255, 0.1);
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), #A53CFF);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-bar button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 77, 255, 0.3);
}

.filters-bar {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filters-bar select,
.filters-bar input {
    padding: 0.5rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.filters-bar select:focus,
.filters-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filters-bar button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 1.25rem;
}

.pagination a {
    padding: 0.5rem 0.875rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--bg-gray);
}

.pagination a.active {
    background: var(--primary-color);
    color: white;
}

/* === MODALS === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-dark);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 77, 255, 0.1);
}

.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.checkbox-list label:hover {
    background: var(--bg-light);
}

/* === SIDEBAR LAYOUT === */
.sidebar-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
}

.sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
}

.sidebar h3 {
    margin: 0 0 0.875rem 0;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li a {
    display: block;
    padding: 0.625rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar li a:hover {
    background: var(--bg-light);
}

.sidebar li a.active {
    background: linear-gradient(135deg, rgba(255, 77, 255, 0.15), rgba(165, 60, 255, 0.15));
    color: var(--primary-color);
}

.sidebar li a .count {
    float: right;
    background: var(--bg-gray);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

/* === PERMISSIONS GRID === */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.875rem;
}

.permission-card {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.permission-card:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.permission-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-family: monospace;
    color: var(--text-dark);
}

.permission-card .display-name {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.625rem;
}

.permission-card .meta {
    display: flex;
    gap: 0.625rem;
    font-size: 0.75rem;
    color: var(--text-lighter);
}

.permission-card .meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* === USER INFO === */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #A53CFF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* === BULK ACTIONS === */
.bulk-actions {
    display: flex;
    gap: 0.625rem;
    padding: 0.875rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.bulk-actions select {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dark);
}

/* === ALERT BANNERS === */
.alert-banner {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.875rem;
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.alert-banner.warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.alert-banner.expiring {
    background: var(--error-light);
    border: 1px solid #fca5a5;
}

.alert-banner .count {
    font-size: 1.5rem;
    font-weight: 700;
}

.alert-banner .message {
    flex: 1;
}

/* === EXPIRY TIMER === */
.expiry-timer {
    font-size: 0.75rem;
    color: var(--error-color);
    font-weight: 600;
}

.expiry-timer.soon {
    background: var(--error-light);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
    .rbac-page,
    .rbac-dashboard {
        padding: 1rem;
    }
    
    .rbac-header {
        padding: 1rem;
    }
    
    .rbac-header h1 {
        font-size: 1.25rem;
    }
    
    .rbac-nav a {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card .value {
        font-size: 1.5rem;
    }
    
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* === META CELLS === */
.meta-cell {
    font-size: 0.75rem;
    color: var(--text-lighter);
}

.meta-cell code {
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* === ACTION BADGES === */
.action-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: monospace;
}

.action-badge.create {
    background: var(--success-light);
    color: var(--success-color);
}

.action-badge.update {
    background: #e0e7ff;
    color: #4f46e5;
}

.action-badge.delete {
    background: var(--error-light);
    color: var(--error-color);
}

.action-badge.grant {
    background: var(--success-light);
    color: var(--success-color);
}

.action-badge.revoke {
    background: #fef3c7;
    color: #d97706;
}

.action-badge.denied {
    background: var(--error-light);
    color: var(--error-color);
}

/* === DEV WARNING === */
.dev-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    gap: 0.875rem;
    align-items: center;
}

.dev-warning .icon {
    font-size: 1.5rem;
}

/* === GRID LAYOUTS === */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* === PROGRESS BAR === */
.progress-bar {
    height: 24px;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 1.25rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #A53CFF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* === STATS GRID VARIANTS === */
.stats-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stat-box {
    padding: 0.875rem 1.25rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 120px;
}

.stat-box .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-box .label {
    font-size: 0.75rem;
    color: var(--text-lighter);
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.625rem;
}

.tabs button {
    padding: 0.625rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.2s ease;
}

.tabs button:hover {
    color: var(--text-dark);
    background: var(--bg-light);
}

.tabs button.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === CODE BLOCKS === */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.8rem;
    overflow-x: auto;
}

/* === TOOL CARDS === */
.tool-card {
    padding: 1.25rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.875rem;
}

.tool-card h3 {
    margin: 0 0 0.625rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-dark);
}

.tool-card p {
    margin: 0 0 0.875rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* === OUTPUT BOX === */
.output-box {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.625rem;
    display: none;
}

.output-box.active {
    display: block;
}

/* === VALIDATION RESULTS === */
.validation-results {
    max-height: 400px;
    overflow-y: auto;
}

.check-item {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.check-item:last-child {
    border-bottom: none;
}

.check-icon {
    font-size: 1.125rem;
}

.check-icon.passed {
    color: var(--success-color);
}

.check-icon.failed {
    color: var(--error-color);
}

.check-icon.warning {
    color: #f59e0b;
}

.check-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.check-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.check-content .issues {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--error-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--error-color);
}

/* === RECOMMENDATION CARDS === */
.recommendation {
    padding: 0.875rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
}

.recommendation h4 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-dark);
}

.recommendation p {
    margin: 0 0 0.625rem 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.recommendation .files {
    font-size: 0.75rem;
    color: var(--text-lighter);
    font-family: monospace;
}

/* === PRIORITY BADGES === */
.priority-badge,
.priority-tag {
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.priority-badge.high,
.priority-tag.high {
    background: var(--error-light);
    color: var(--error-color);
}

.priority-badge.medium,
.priority-tag.medium {
    background: #fef3c7;
    color: #d97706;
}

.priority-badge.low,
.priority-tag.low {
    background: var(--bg-gray);
    color: var(--text-light);
}

/* === SUGGESTION CARDS === */
.suggestion-card {
    padding: 0.875rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.suggestion-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
}

.suggestion-card p {
    margin: 0 0 0.625rem 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.suggestion-card .files {
    font-size: 0.75rem;
    color: var(--text-lighter);
}

/* === PERMISSION LIST === */
.permission-list {
    max-height: 300px;
    overflow-y: auto;
}

.permission-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-dark);
}

/* === MARKDOWN CONTENT === */
.markdown-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.markdown-content h1 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.625rem;
    margin: 1.875rem 0 1.25rem;
    color: var(--text-dark);
}

.markdown-content h2 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.875rem;
    color: var(--text-dark);
}

.markdown-content h3 {
    font-size: 1rem;
    margin: 1.25rem 0 0.625rem;
    color: var(--text-medium);
}

.markdown-content pre {
    background: var(--bg-light);
    padding: 0.875rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.markdown-content code {
    background: var(--bg-gray);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.875rem 0;
}

.markdown-content th,
.markdown-content td {
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-content th {
    background: var(--bg-light);
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5rem;
}

.markdown-content li {
    margin: 0.25rem 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 0.875rem;
    margin: 0.875rem 0;
    color: var(--text-light);
}
