/* Admin Dashboard - Instance Management, Reports Tables, Roles & Permissions */

/* Instance Management */
.inst-mgmt-header { 
    margin-bottom: 24px; 
}

.inst-mgmt-header h1 { 
    margin: 0 0 4px 0; 
    color: #333; 
    font-size: 28px; 
}

.inst-mgmt-header .subtitle { 
    color: #666; 
    font-size: 15px; 
    margin: 0; 
}

.inst-mgmt-section-title { 
    font-size: 20px; 
    font-weight: 600; 
    color: #333; 
    margin: 0 0 16px 0; 
    padding-bottom: 8px; 
    border-bottom: 2px solid #dee2e6; 
}

.inst-mgmt-tabs { 
    display: flex; 
    gap: 0; 
    border-bottom: 2px solid #dee2e6; 
    margin-bottom: 20px; 
}

.inst-mgmt-tab { 
    padding: 10px 20px; 
    background: none; 
    border: none; 
    border-bottom: 3px solid transparent; 
    margin-bottom: -2px; 
    font-size: 15px; 
    color: #666; 
    cursor: pointer; 
}

.inst-mgmt-tab.active { 
    color: #dc3545; 
    font-weight: 600; 
    border-bottom-color: #dc3545; 
}

.inst-mgmt-subtitle { 
    margin: 0 0 16px 0; 
    font-size: 16px; 
    color: #333; 
}

.inst-card { 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    margin-bottom: 16px; 
    overflow: hidden; 
    background: #fff; 
}

.inst-card-header { 
    padding: 14px 16px; 
    cursor: pointer; 
    background: #f8f9fa; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 600; 
    color: #333; 
}

.inst-card-header::before { 
    content: ''; 
    display: inline-block; 
    width: 0; 
    height: 0; 
    border-left: 5px solid transparent; 
    border-right: 5px solid transparent; 
    border-top: 6px solid #555; 
    transition: transform 0.2s; 
}

.inst-card.open .inst-card-header::before { 
    transform: rotate(-90deg); 
}

.inst-card-body { 
    padding: 20px; 
    border-top: 1px solid #eee; 
    display: none; 
}

.inst-card.open .inst-card-body { 
    display: block; 
}

.inst-remove-btn { 
    padding: 8px 16px; 
    background: #f8f9fa; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    font-size: 14px; 
    color: #333; 
    cursor: pointer; 
    margin-top: 8px; 
}

.inst-remove-btn:hover { 
    background: #e9ecef; 
}

/* Import/Export Configuration */
.import-export-heading { 
    margin: 0 0 20px 0; 
    font-size: 20px; 
    font-weight: 600; 
    color: #333; 
}

.import-export-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 32px; 
    align-items: start; 
}

.import-export-section { 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    padding: 24px; 
    background: #fff; 
}

.import-export-section h4 { 
    margin: 0 0 16px 0; 
    font-size: 16px; 
    font-weight: 600; 
    color: #333; 
}

.export-download-btn { 
    padding: 10px 20px; 
    background: #6c757d; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    font-size: 14px; 
    font-weight: 500; 
    cursor: pointer; 
}

.export-download-btn:hover { 
    background: #5a6268; 
}

.import-upload-label { 
    display: block; 
    font-size: 13px; 
    font-weight: 500; 
    color: #333; 
    margin-bottom: 10px; 
}

.import-drop-zone {
    border: 2px dashed #ccc; 
    border-radius: 8px; 
    padding: 32px 24px; 
    text-align: center;
    background: #f8f9fa; 
    margin-bottom: 12px; 
    transition: border-color 0.2s, background 0.2s;
}

.import-drop-zone.dragover { 
    border-color: #007bff; 
    background: #e7f1ff; 
}

.import-drop-zone .drop-icon { 
    font-size: 48px; 
    color: #999; 
    margin-bottom: 12px; 
}

.import-drop-zone .drop-text { 
    font-size: 14px; 
    color: #555; 
    margin-bottom: 4px; 
}

.import-drop-zone .drop-hint { 
    font-size: 12px; 
    color: #888; 
}

.import-browse-wrap { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex-wrap: wrap; 
}

.import-browse-btn { 
    padding: 10px 20px; 
    background: #f8f9fa; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    font-size: 14px; 
    color: #333; 
    cursor: pointer; 
}

.import-browse-btn:hover { 
    background: #e9ecef; 
}

#importConfigFileInput { 
    display: none; 
}

@media (max-width: 640px) { 
    .import-export-grid { 
        grid-template-columns: 1fr; 
    } 
}

/* Roles & Permissions */
.user-mgmt-panel-roles.user-mgmt-content-card h3 {
    margin-bottom: 20px;
}

.roles-counts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin-bottom: 24px;
}

.roles-count-block {
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid #ddd;
}

.roles-count-block:last-child { 
    border-right: none; 
}

.roles-count-block .role-label {
    font-size: 14px;
    color: #555;
    margin: 0 0 8px 0;
}

.roles-count-block .role-count {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

.roles-matrix-heading {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

/* Role Descriptions */
.role-descriptions-heading {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 16px 0;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.role-desc-section {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.role-desc-section:last-child { 
    margin-bottom: 0; 
}

.role-desc-header {
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    list-style: none;
    user-select: none;
}

.role-desc-header::-webkit-details-marker { 
    display: none; 
}

.role-desc-header::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #555;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.role-desc-section[open] .role-desc-header::before {
    transform: rotate(-90deg);
}

.role-desc-header-inner { 
    flex: 1; 
}

.role-desc-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.role-desc-subtitle {
    font-size: 13px;
    color: #555;
    margin: 4px 0 0 0;
}

.role-desc-body {
    padding: 12px 16px 16px 40px;
    background: #fff;
    border-top: 1px solid #eee;
}

.role-desc-list {
    margin: 0;
    padding-left: 20px;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.role-desc-list li { 
    margin-bottom: 6px; 
}

.role-desc-list li:last-child { 
    margin-bottom: 0; 
}
